summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorHartmut Holzgraefe <hartmut@php.net>2022-04-29 10:10:02 +0200
committerDaniel Black <daniel@mariadb.org>2022-05-06 22:50:01 +1000
commit9fe3bc2aa881118def3987358935e77c39b9fdb8 (patch)
tree1aa93ad58a6118943c38f3b301c146e7aaf1cae5 /client
parent06562b84f65fe5089288f3ca180d06361bb40c8e (diff)
downloadmariadb-git-9fe3bc2aa881118def3987358935e77c39b9fdb8.tar.gz
MDEV-27816 Set sql_mode before DROP IF EXISTS already
Previously the correct SQL mode for a stored routine or package was only set before doing the CREATE part, this worked out for PROCEDUREs and FUNCTIONs, but with ORACLE mode specific PACKAGEs the DROP also only works in ORACLE mode. Moving the setting of the sql_mode a few lines up to happen right before the DROP statement is writen fixes this.
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 20f8278c9c2..991c3f528b4 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2757,6 +2757,9 @@ static uint dump_routines_for_db(char *db)
create_caption_xml[i]);
continue;
}
+
+ switch_sql_mode(sql_file, ";", row[1]);
+
if (opt_drop)
fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
routine_type[i], routine_name);
@@ -2796,9 +2799,6 @@ static uint dump_routines_for_db(char *db)
"--\n");
}
-
- switch_sql_mode(sql_file, ";", row[1]);
-
fprintf(sql_file,
"DELIMITER ;;\n"
"%s ;;\n"