mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
committed by
Daniel Black
parent
06562b84f6
commit
9fe3bc2aa8
@ -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"
|
||||
|
Reference in New Issue
Block a user