1
0
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:
igreenhoe@mysql.com
2006-06-21 00:12:23 -07:00
parent 52d86dff85
commit 85d130c58b
2 changed files with 48 additions and 63 deletions

View File

@ -1722,17 +1722,18 @@ static void dumpTable(uint numFields, char *table)
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)
{
fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table);
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 */
row_break=0;
@ -1991,17 +1992,19 @@ static void dumpTable(uint numFields, char *table)
error= EX_CONSCHECK;
goto err;
}
if (opt_lock)
{
fputs("UNLOCK TABLES;\n", md_result_file);
check_io(md_result_file);
}
/* Moved enable keys to before unlock per bug 15977 */
if (opt_disable_keys)
{
fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n",
opt_quoted_table);
check_io(md_result_file);
}
if (opt_lock)
{
fputs("UNLOCK TABLES;\n", md_result_file);
check_io(md_result_file);
}
if (opt_autocommit)
{
fprintf(md_result_file, "commit;\n");

File diff suppressed because one or more lines are too long