From 800f2f46d16ecf467b9f65c6a35acde1ce9ea6ff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Oct 2003 17:26:26 -0400 Subject: [PATCH] added quotas for database names (fixed bug #1348) client/mysqldump.c: added quotas for database names --- client/mysqldump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index b28373ccd4a..40f88021c89 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1271,10 +1271,13 @@ static int init_dumping(char *database) { if (opt_databases || opt_alldbs) { + /* length of table name * 2 (if name contain quotas), 2 quotas and 0 */ + char quoted_database_buf[64*2+3]; + char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted); fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", database); if (!opt_create_db) fprintf(md_result_file,"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n", - database); + qdatabase); fprintf(md_result_file,"\nUSE %s;\n", database); } }