summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-11-02 12:24:45 +0400
committerunknown <gluh@mysql.com/eagle.(none)>2007-11-02 12:24:45 +0400
commit2c6a5fd27e567fc41834a4af527736fa68ec0a73 (patch)
tree02c7d6a7bfbb39c80c5c53852c397634c1eb6c4b /client
parent61bd5d0fec4e4089642aac3f0d4b07c354dec5c8 (diff)
downloadmariadb-git-2c6a5fd27e567fc41834a4af527736fa68ec0a73.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. client/mysqldump.c: db name should be quoted. this code does communication with the server. it's always ok to quote names in this case. mysql-test/r/mysqldump.result: test result mysql-test/t/mysqldump.test: test case
Diffstat (limited to 'client')
-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;