summaryrefslogtreecommitdiff
path: root/sql/sql_partition.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r--sql/sql_partition.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 04b7703ef88..67190c94a56 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -3990,6 +3990,7 @@ static int fast_end_partition(THD *thd, ulonglong copied,
DBUG_RETURN(FALSE);
}
table->file->print_error(error, MYF(0));
+ close_thread_tables(thd);
DBUG_RETURN(TRUE);
}
@@ -6112,7 +6113,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
(error= table->file->repair_partitions(thd))))
{
table->file->print_error(error, MYF(0));
- DBUG_RETURN(TRUE);
+ goto err;
}
}
else if (fast_alter_partition & HA_PARTITION_ONE_PHASE)
@@ -6159,7 +6160,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
if (mysql_write_frm(lpt, WFRM_WRITE_SHADOW | WFRM_PACK_FRM) ||
mysql_change_partitions(lpt))
{
- DBUG_RETURN(TRUE);
+ goto err;
}
}
else if (alter_info->flags == ALTER_DROP_PARTITION)
@@ -6252,7 +6253,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
(release_name_lock(lpt), FALSE))
{
handle_alter_part_error(lpt, not_completed, TRUE, frm_install);
- DBUG_RETURN(TRUE);
+ goto err;
}
}
else if ((alter_info->flags & ALTER_ADD_PARTITION) &&
@@ -6321,7 +6322,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
(release_name_lock(lpt), FALSE))
{
handle_alter_part_error(lpt, not_completed, FALSE, frm_install);
- DBUG_RETURN(TRUE);
+ goto err;
}
}
else
@@ -6414,7 +6415,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
(release_name_lock(lpt), FALSE))
{
handle_alter_part_error(lpt, not_completed, FALSE, frm_install);
- DBUG_RETURN(TRUE);
+ goto err;
}
}
/*
@@ -6424,6 +6425,9 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
DBUG_RETURN(fast_end_partition(thd, lpt->copied, lpt->deleted,
table, table_list, FALSE, NULL,
written_bin_log));
+err:
+ close_thread_tables(thd);
+ DBUG_RETURN(TRUE);
}
#endif