diff options
author | Jim Winstead <jimw@mysql.com> | 2009-05-12 10:38:14 -0700 |
---|---|---|
committer | Jim Winstead <jimw@mysql.com> | 2009-05-12 10:38:14 -0700 |
commit | e3fa685917a2c448522d46e938bff1b12a46ab89 (patch) | |
tree | ddc55898f9fc8263631157bbbd19855434f30196 /client | |
parent | 16ef088112e9a5016638d2856c1a2ca469749596 (diff) | |
download | mariadb-git-e3fa685917a2c448522d46e938bff1b12a46ab89.tar.gz |
mysqldump would not dump the INFORMATION_SCHEMA even when it was explicitly
requested. (Bug #33762)
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 323376dd8bf..efcb1820be4 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3813,6 +3813,10 @@ static int dump_all_databases() return 1; while ((row= mysql_fetch_row(tableres))) { + if (mysql_get_server_version(mysql) >= 50003 && + !my_strcasecmp(&my_charset_latin1, row[0], "information_schema")) + continue; + if (dump_all_tables_in_db(row[0])) result=1; } @@ -3827,6 +3831,10 @@ static int dump_all_databases() } while ((row= mysql_fetch_row(tableres))) { + if (mysql_get_server_version(mysql) >= 50003 && + !my_strcasecmp(&my_charset_latin1, row[0], "information_schema")) + continue; + if (dump_all_views_in_db(row[0])) result=1; } @@ -3933,10 +3941,6 @@ int init_dumping_tables(char *qdatabase) static int init_dumping(char *database, int init_func(char*)) { - if (mysql_get_server_version(mysql) >= 50003 && - !my_strcasecmp(&my_charset_latin1, database, "information_schema")) - return 1; - if (mysql_select_db(mysql, database)) { DB_error(mysql, "when selecting the database"); @@ -3995,6 +3999,7 @@ static int dump_all_tables_in_db(char *database) DBUG_RETURN(1); if (opt_xml) print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS); + if (lock_tables) { DYNAMIC_STRING query; @@ -4228,7 +4233,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables) } end= pos; - if (lock_tables) + /* Can't LOCK TABLES in INFORMATION_SCHEMA, so don't try. */ + if (lock_tables && + !(mysql_get_server_version(mysql) >= 50003 && + !my_strcasecmp(&my_charset_latin1, db, "information_schema"))) { if (mysql_real_query(mysql, lock_tables_query.str, lock_tables_query.length-1)) |