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:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user