mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
@ -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,10 +2243,20 @@ static void get_actual_table_name(const char *old_table_name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tableRes= mysql_store_result( sock );
|
tableRes= mysql_store_result( sock );
|
||||||
|
retval = 1;
|
||||||
|
if (tableRes != NULL)
|
||||||
|
{
|
||||||
|
my_ulonglong numRows = mysql_num_rows(tableRes);
|
||||||
|
if (numRows > 0)
|
||||||
|
{
|
||||||
row= mysql_fetch_row( tableRes );
|
row= mysql_fetch_row( tableRes );
|
||||||
strmake(new_table_name, row[0], buf_size-1);
|
strmake(new_table_name, row[0], buf_size-1);
|
||||||
|
retval = 0;
|
||||||
|
}
|
||||||
mysql_free_result(tableRes);
|
mysql_free_result(tableRes);
|
||||||
}
|
}
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int dump_selected_tables(char *db, char **table_names, int tables)
|
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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user