mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
fixed bug #2705 "mysqldump --tab extra output"
client/mysqldump.c: fixed bug #2705 "mysqldump --tab extra output" and splited setting of sql_mode to separate line to merge with 4.0
This commit is contained in:
@ -366,11 +366,16 @@ static void write_header(FILE *sql_file, char *db_name)
|
||||
}
|
||||
if (!opt_set_names)
|
||||
fprintf(sql_file,"\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=%s */;\n",default_charset);
|
||||
fprintf(md_result_file,"\
|
||||
if (!path)
|
||||
{
|
||||
fprintf(md_result_file,"\
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n\
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n\
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;\n\
|
||||
");
|
||||
}
|
||||
fprintf(sql_file,
|
||||
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s\" */;\n",
|
||||
path?"":"NO_AUTO_VALUE_ON_ZERO");
|
||||
}
|
||||
return;
|
||||
} /* write_header */
|
||||
@ -382,12 +387,15 @@ static void write_footer(FILE *sql_file)
|
||||
fputs("</mysqldump>\n", sql_file);
|
||||
else if (!opt_compact)
|
||||
{
|
||||
fprintf(md_result_file,"\n\
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n\
|
||||
fprintf(sql_file,"\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n");
|
||||
if (!path)
|
||||
{
|
||||
fprintf(md_result_file,"\
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n\
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n");
|
||||
}
|
||||
if (!opt_set_names)
|
||||
fprintf(md_result_file,
|
||||
fprintf(sql_file,
|
||||
"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n");
|
||||
fputs("\n", sql_file);
|
||||
}
|
||||
@ -1153,7 +1161,11 @@ static uint getTableStructure(char *table, char* db)
|
||||
strpos=strmov(strpos,"(");
|
||||
}
|
||||
if (sql_file != md_result_file)
|
||||
{
|
||||
fputs("\n", sql_file);
|
||||
write_footer(sql_file);
|
||||
my_fclose(sql_file, MYF(MY_WME));
|
||||
}
|
||||
DBUG_RETURN(numFields);
|
||||
} /* getTableStructure */
|
||||
|
||||
@ -1940,7 +1952,8 @@ MASTER_LOG_POS=%s ;\n",row[0],row[1]);
|
||||
}
|
||||
}
|
||||
dbDisconnect(current_host);
|
||||
write_footer(md_result_file);
|
||||
if (!path)
|
||||
write_footer(md_result_file);
|
||||
if (md_result_file != stdout)
|
||||
my_fclose(md_result_file, MYF(0));
|
||||
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
||||
|
Reference in New Issue
Block a user