summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
diff options
context:
space:
mode:
authoriggy@rolltop.ignatz42.dyndns.org <>2006-07-17 18:07:08 -0400
committeriggy@rolltop.ignatz42.dyndns.org <>2006-07-17 18:07:08 -0400
commitad12809f35b196a5859a85bad53ba0d5e4f5b9f4 (patch)
tree749cdf0e9f005bea8ca17f159e5c065200023800 /client/mysqldump.c
parent00ec3973f72d80966e134d1d4bf521f8dcf02ea2 (diff)
downloadmariadb-git-ad12809f35b196a5859a85bad53ba0d5e4f5b9f4.tar.gz
Bug# 20221- Dumping of multiple databases containing view(s) yields maleformed dumps.
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r--client/mysqldump.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 9469815bfaf..13e2b80c0b2 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2637,7 +2637,7 @@ static int init_dumping(char *database)
/*
length of table name * 2 (if name contains quotes), 2 quotes and 0
*/
- char quoted_database_buf[64*2+3];
+ char quoted_database_buf[NAME_LEN*2+3];
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
if (opt_comments)
{
@@ -2786,7 +2786,18 @@ static my_bool dump_all_views_in_db(char *database)
DB_error(sock, "when selecting the database");
return 1;
}
-
+ if (opt_databases || opt_alldbs)
+ {
+ char quoted_database_buf[NAME_LEN*2+3];
+ char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
+ if (opt_comments)
+ {
+ fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase);
+ check_io(md_result_file);
+ }
+ fprintf(md_result_file,"\nUSE %s;\n", qdatabase);
+ check_io(md_result_file);
+ }
if (opt_xml)
print_xml_tag1(md_result_file, "", "database name=", database, "\n");
if (lock_tables)
@@ -3239,7 +3250,7 @@ static char *primary_key_fields(const char *table_name)
MYSQL_RES *res = NULL;
MYSQL_ROW row;
/* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */
- char show_keys_buff[15 + 64 * 2 + 3];
+ char show_keys_buff[15 + NAME_LEN * 2 + 3];
uint result_length = 0;
char *result = 0;