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:
@ -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;
|
||||
|
Reference in New Issue
Block a user