1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
gluh@mysql.com/eagle.(none)
2007-11-02 12:24:45 +04:00
parent e0e6547296
commit b0e9fa31af
3 changed files with 34 additions and 1 deletions

View File

@ -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;