mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Bug#28223: mysqldump --compact --routines restores from @OLD_SQL_MODE w/o ever setting it
- mysqldump generated output that set OLD_SQL_MODE twice, to different values
(for triggers), or not at all (for routines) in some cases.
client/mysqldump.c:
Only save SQL_MODE in dump_triggers if in --compact mode. Otherwise,
it's already been saved in write_header(). Likewise for dumpe_routines,
where it was never saved.
mysql-test/r/mysqldump.result:
mysqldump output has subtly changed. Adjust test-results. This also shows
OLD_SQL_MODE is always set exactly once now
This commit is contained in:
parent
e9e6b9e477
commit
e675d25771
2 changed files with 12 additions and 6 deletions
|
|
@ -1456,6 +1456,9 @@ static uint dump_routines_for_db(char *db)
|
|||
if (lock_tables)
|
||||
mysql_query(mysql, "LOCK TABLES mysql.proc READ");
|
||||
|
||||
if (opt_compact)
|
||||
fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
|
||||
|
||||
fprintf(sql_file, "DELIMITER ;;\n");
|
||||
|
||||
/* 0, retrieve and dump functions, 1, procedures */
|
||||
|
|
@ -2106,8 +2109,11 @@ static void dump_triggers_for_table(char *table,
|
|||
DBUG_VOID_RETURN;
|
||||
}
|
||||
if (mysql_num_rows(result))
|
||||
fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n\
|
||||
DELIMITER ;;\n");
|
||||
{
|
||||
if (opt_compact)
|
||||
fprintf(sql_file, "\n/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n");
|
||||
fprintf(sql_file, "\nDELIMITER ;;\n");
|
||||
}
|
||||
while ((row= mysql_fetch_row(result)))
|
||||
{
|
||||
fprintf(sql_file,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue