1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

SQL: TRT failure fixes [closes #318]

Unclosed stmt transaction
TRT failure in inplace

Related to #305
This commit is contained in:
Aleksey Midenkov
2017-11-13 14:27:58 +03:00
parent cc6701a7b3
commit 72274c10f0
5 changed files with 50 additions and 32 deletions

View File

@ -7428,11 +7428,22 @@ static bool mysql_inplace_alter_table(THD *thd,
DEBUG_SYNC(thd, "alter_table_inplace_before_commit");
THD_STAGE_INFO(thd, stage_alter_inplace_commit);
if (table->file->ha_commit_inplace_alter_table(altered_table,
ha_alter_info,
true))
{
goto rollback;
TR_table trt(thd, true);
if (table->file->native_versioned())
{
if (trt.update())
return true;
}
if (table->file->ha_commit_inplace_alter_table(altered_table,
ha_alter_info,
true))
{
goto rollback;
}
thd->drop_temporary_table(altered_table, NULL, false);
}
close_all_tables_for_name(thd, table->s,
@ -7442,8 +7453,6 @@ static bool mysql_inplace_alter_table(THD *thd,
NULL);
table_list->table= table= NULL;
thd->drop_temporary_table(altered_table, NULL, false);
/*
Replace the old .FRM with the new .FRM, but keep the old name for now.
Rename to the new name (if needed) will be handled separately below.