mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#32943: Fixed buggy lock handling of ALTER TABLE for partitioning
mysql-test/r/partition_range.result: Added new test cases for lock tables and ALTER TABLE for partitions, also added a test case with a trigger. mysql-test/t/partition_range.test: Added new test cases for lock tables and ALTER TABLE for partitions, also added a test case with a trigger. sql/mysql_priv.h: Added WFRM_KEEP_SHARE for use of code not to be used otherwise sql/sql_partition.cc: Removed get_name_lock and release_name_lock, use close_data_files_and_morph_locks which leaves an exclusive name lock after completing. Reopen table after completing if under lock tables Updated comments sql/sql_table.cc: Ensure that code to set partition syntax isn't used other than when specifically asked to do it.
This commit is contained in:
@@ -9,6 +9,41 @@
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# BUG 32943:
|
||||
# Locking problems in relation to partitioning and triggers
|
||||
# Also fixes and test cases of generic lock issues with
|
||||
# partition change code.
|
||||
#
|
||||
create table t1 (a integer)
|
||||
partition by range (a)
|
||||
( partition p0 values less than (4),
|
||||
partition p1 values less than (100));
|
||||
|
||||
delimiter |;
|
||||
create trigger tr1 before insert on t1
|
||||
for each row begin
|
||||
set @a = 1;
|
||||
end|
|
||||
|
||||
delimiter ;|
|
||||
alter table t1 drop partition p0;
|
||||
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a integer)
|
||||
partition by range (a)
|
||||
( partition p0 values less than (4),
|
||||
partition p1 values less than (100));
|
||||
LOCK TABLES t1 WRITE;
|
||||
alter table t1 drop partition p0;
|
||||
alter table t1 reorganize partition p1 into
|
||||
( partition p0 values less than (4),
|
||||
partition p1 values less than (100));
|
||||
alter table t1 add partition ( partition p2 values less than (200));
|
||||
UNLOCK TABLES;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG 18198: Various tests for partition functions
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user