summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
diff options
context:
space:
mode:
authorRutuja Surve <rutuja.r.surve@gmail.com>2018-06-10 11:19:39 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-06-10 16:50:36 +0300
commit1d43f71c7b4c39a6fd196c104b5ebafb65376199 (patch)
tree80dd185c7dd5d277038f5b97504d5cc0bcfefc01 /client/mysqldump.c
parent953d70f960421ef4a6a2d711b66ef3d04592efc7 (diff)
downloadmariadb-git-1d43f71c7b4c39a6fd196c104b5ebafb65376199.tar.gz
MDEV-15021: mysqldump --tables --routines generates non importable dump file
The order of outputting stored procedures is important. Stored procedures must be available on view creation, for views which make use of them. Make sure to print them before outputting tables.
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r--client/mysqldump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 4e611ed5cb2..ad71a4dd0ce 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -4701,6 +4701,12 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (opt_xml)
print_xml_tag(md_result_file, "", "\n", "database", "name=", db, NullS);
+ /* obtain dump of routines (procs/functions) */
+ if (opt_routines && mysql_get_server_version(mysql) >= 50009)
+ {
+ DBUG_PRINT("info", ("Dumping routines for database %s", db));
+ dump_routines_for_db(db);
+ }
/* Dump each selected table */
for (pos= dump_tables; pos < end; pos++)
{
@@ -4729,12 +4735,6 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
DBUG_PRINT("info", ("Dumping events for database %s", db));
dump_events_for_db(db);
}
- /* obtain dump of routines (procs/functions) */
- if (opt_routines && mysql_get_server_version(mysql) >= 50009)
- {
- DBUG_PRINT("info", ("Dumping routines for database %s", db));
- dump_routines_for_db(db);
- }
free_root(&root, MYF(0));
my_free(order_by);
order_by= 0;