summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
diff options
context:
space:
mode:
authorgluh@mysql.com/eagle.(none) <>2007-11-02 12:24:45 +0400
committergluh@mysql.com/eagle.(none) <>2007-11-02 12:24:45 +0400
commitb0e9fa31afb8c110bb1dcef0f1f46d20279ba6b6 (patch)
tree02c7d6a7bfbb39c80c5c53852c397634c1eb6c4b /client/mysqldump.c
parente0e6547296bb06131b3359467b2c4aef9e087a39 (diff)
downloadmariadb-git-b0e9fa31afb8c110bb1dcef0f1f46d20279ba6b6.tar.gz
Bug#31113 mysqldump 5.1 can't handle a dash ("-") in database names
db name should be quoted. this code does communication with the server. it's always ok to quote names in this case.
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r--client/mysqldump.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index d504d177490..f5362b272cd 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -1040,8 +1040,10 @@ static int fetch_db_collation(const char *db_name,
char query[QUERY_LENGTH];
MYSQL_RES *db_cl_res;
MYSQL_ROW db_cl_row;
+ char quoted_database_buf[NAME_LEN*2+3];
+ char *qdatabase= quote_name(db_name, quoted_database_buf, 1);
- my_snprintf(query, sizeof (query), "use %s", db_name);
+ my_snprintf(query, sizeof (query), "use %s", qdatabase);
if (mysql_query_with_error_report(mysql, NULL, query))
return 1;