Commit dddad632 authored by unknown's avatar unknown

Merge


client/mysqldump.c:
  merged changes for bug #9175
parents 64455348 562c59f8
...@@ -2218,13 +2218,14 @@ static my_bool dump_all_views_in_db(char *database) ...@@ -2218,13 +2218,14 @@ static my_bool dump_all_views_in_db(char *database)
different case (e.g. T1 vs t1) different case (e.g. T1 vs t1)
RETURN RETURN
void int - 0 if a tablename was retrieved. 1 if not
*/ */
static void get_actual_table_name(const char *old_table_name, static int get_actual_table_name(const char *old_table_name,
char *new_table_name, char *new_table_name,
int buf_size) int buf_size)
{ {
int retval;
MYSQL_RES *tableRes; MYSQL_RES *tableRes;
MYSQL_ROW row; MYSQL_ROW row;
char query[50 + 2*NAME_LEN]; char query[50 + 2*NAME_LEN];
...@@ -2242,9 +2243,19 @@ static void get_actual_table_name(const char *old_table_name, ...@@ -2242,9 +2243,19 @@ static void get_actual_table_name(const char *old_table_name,
} }
tableRes= mysql_store_result( sock ); tableRes= mysql_store_result( sock );
row= mysql_fetch_row( tableRes ); retval = 1;
strmake(new_table_name, row[0], buf_size-1); if (tableRes != NULL)
mysql_free_result(tableRes); {
my_ulonglong numRows = mysql_num_rows(tableRes);
if (numRows > 0)
{
row= mysql_fetch_row( tableRes );
strmake(new_table_name, row[0], buf_size-1);
retval = 0;
}
mysql_free_result(tableRes);
}
return retval;
} }
...@@ -2284,11 +2295,13 @@ static int dump_selected_tables(char *db, char **table_names, int tables) ...@@ -2284,11 +2295,13 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
char new_table_name[NAME_LEN]; char new_table_name[NAME_LEN];
/* the table name passed on commandline may be wrong case */ /* the table name passed on commandline may be wrong case */
get_actual_table_name( table_names[i], new_table_name, sizeof(new_table_name) ); if (!get_actual_table_name( table_names[i], new_table_name, sizeof(new_table_name) ))
{
numrows = getTableStructure(new_table_name, db); numrows = getTableStructure(new_table_name, db);
dumpTable(numrows, new_table_name); dumpTable(numrows, new_table_name);
}
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
order_by= 0; order_by= 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment