diff options
author | Nirbhay Choubey <nirbhay.choubey@sun.com> | 2011-02-21 12:42:27 +0530 |
---|---|---|
committer | Nirbhay Choubey <nirbhay.choubey@sun.com> | 2011-02-21 12:42:27 +0530 |
commit | a5f20712a0ab7e40bd577d593b063d1391723308 (patch) | |
tree | f8b983f462caf3b4c398c91a5c667c7d096119f5 /client/mysqldump.c | |
parent | b7d30e274d18635402cb38e543edf6ed1abd334b (diff) | |
parent | 876502d7439f3cf34d8554d22f28f06bf8b54388 (diff) | |
download | mariadb-git-a5f20712a0ab7e40bd577d593b063d1391723308.tar.gz |
Merge of fix for bug#11766310 from mysql-5.1 -> mysql-5.5.
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 66f0c2801f5..c2d526edd4e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1153,6 +1153,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) @@ -1160,7 +1163,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); @@ -1181,6 +1184,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) @@ -1188,7 +1194,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); |