diff options
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index c21bf2f5cb7..555efa14fd2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1136,6 +1136,9 @@ static int switch_db_collation(FILE *sql_file, { if (strcmp(current_db_cl_name, required_db_cl_name) != 0) { + char quoted_db_buf[NAME_LEN * 2 + 3]; + char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE); + CHARSET_INFO *db_cl= get_charset_by_name(required_db_cl_name, MYF(0)); if (!db_cl) @@ -1143,7 +1146,7 @@ static int switch_db_collation(FILE *sql_file, fprintf(sql_file, "ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n", - (const char *) db_name, + (const char *) quoted_db_name, (const char *) db_cl->csname, (const char *) db_cl->name, (const char *) delimiter); @@ -1164,6 +1167,9 @@ static int restore_db_collation(FILE *sql_file, const char *delimiter, const char *db_cl_name) { + char quoted_db_buf[NAME_LEN * 2 + 3]; + char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE); + CHARSET_INFO *db_cl= get_charset_by_name(db_cl_name, MYF(0)); if (!db_cl) @@ -1171,7 +1177,7 @@ static int restore_db_collation(FILE *sql_file, fprintf(sql_file, "ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n", - (const char *) db_name, + (const char *) quoted_db_name, (const char *) db_cl->csname, (const char *) db_cl->name, (const char *) delimiter); |