1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Fixed MDEV-365 "Got assertion when doing alter table on a partition"

mysql-test/r/partition.result:
  Added test case
mysql-test/t/partition.test:
  Added test case
sql/sql_partition.cc:
  Do mysql_trans_prepare_alter_copy_data() after all original tables are locked.
  (We don't want to disable transactions for the original tables, that still may be in the cache)
sql/sql_table.cc:
  Fixed two wrong DBUG_ENTER
This commit is contained in:
Michael Widenius
2012-08-15 13:33:37 +03:00
parent 9c1cc61caf
commit fbe5ac4e24
4 changed files with 30 additions and 4 deletions

View File

@@ -5500,10 +5500,12 @@ static bool mysql_change_partitions(ALTER_PARTITION_PARAM_TYPE *lpt)
build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0);
if(mysql_trans_prepare_alter_copy_data(thd))
/* First lock the original tables */
if (file->ha_external_lock(thd, F_WRLCK))
DBUG_RETURN(TRUE);
if (file->ha_external_lock(thd, F_WRLCK))
/* Disable transactions for all new tables */
if (mysql_trans_prepare_alter_copy_data(thd))
DBUG_RETURN(TRUE);
/* TODO: test if bulk_insert would increase the performance */