mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03: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. --- Merge blasphemy.mysql.com:/home/tnurnberg/28223/50-28223 into blasphemy.mysql.com:/home/tnurnberg/28223/51-28223
This commit is contained in:
@ -1608,6 +1608,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 */
|
||||
@ -2264,8 +2267,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,
|
||||
|
Reference in New Issue
Block a user