mirror of
https://github.com/MariaDB/server.git
synced 2025-07-10 04:22:00 +03:00
Fix for bug #15977 (switch ordering of DISABLE KEYS/LOCK TABLE in mysqldump)
This commit is contained in:
@ -1722,17 +1722,18 @@ static void dumpTable(uint numFields, char *table)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opt_disable_keys)
|
|
||||||
{
|
|
||||||
fprintf(md_result_file, "\n/*!40000 ALTER TABLE %s DISABLE KEYS */;\n",
|
|
||||||
opt_quoted_table);
|
|
||||||
check_io(md_result_file);
|
|
||||||
}
|
|
||||||
if (opt_lock)
|
if (opt_lock)
|
||||||
{
|
{
|
||||||
fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table);
|
fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table);
|
||||||
check_io(md_result_file);
|
check_io(md_result_file);
|
||||||
}
|
}
|
||||||
|
/* Moved disable keys to after lock per bug 15977 */
|
||||||
|
if (opt_disable_keys)
|
||||||
|
{
|
||||||
|
fprintf(md_result_file, "/*!40000 ALTER TABLE %s DISABLE KEYS */;\n",
|
||||||
|
opt_quoted_table);
|
||||||
|
check_io(md_result_file);
|
||||||
|
}
|
||||||
|
|
||||||
total_length= opt_net_buffer_length; /* Force row break */
|
total_length= opt_net_buffer_length; /* Force row break */
|
||||||
row_break=0;
|
row_break=0;
|
||||||
@ -1991,17 +1992,19 @@ static void dumpTable(uint numFields, char *table)
|
|||||||
error= EX_CONSCHECK;
|
error= EX_CONSCHECK;
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (opt_lock)
|
|
||||||
{
|
/* Moved enable keys to before unlock per bug 15977 */
|
||||||
fputs("UNLOCK TABLES;\n", md_result_file);
|
|
||||||
check_io(md_result_file);
|
|
||||||
}
|
|
||||||
if (opt_disable_keys)
|
if (opt_disable_keys)
|
||||||
{
|
{
|
||||||
fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n",
|
fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n",
|
||||||
opt_quoted_table);
|
opt_quoted_table);
|
||||||
check_io(md_result_file);
|
check_io(md_result_file);
|
||||||
}
|
}
|
||||||
|
if (opt_lock)
|
||||||
|
{
|
||||||
|
fputs("UNLOCK TABLES;\n", md_result_file);
|
||||||
|
check_io(md_result_file);
|
||||||
|
}
|
||||||
if (opt_autocommit)
|
if (opt_autocommit)
|
||||||
{
|
{
|
||||||
fprintf(md_result_file, "commit;\n");
|
fprintf(md_result_file, "commit;\n");
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user