diff options
author | unknown <mikael@dator6.(none)> | 2008-01-28 15:20:55 +0100 |
---|---|---|
committer | unknown <mikael@dator6.(none)> | 2008-01-28 15:20:55 +0100 |
commit | 516f95acea961ed8e7c550ba49acdd884678058c (patch) | |
tree | eee66d997bf96e08c1fdff43a4307896443a02c8 /mysql-test | |
parent | 4bacd53715ac860c6ba2d9c148f87d22cae9c62a (diff) | |
download | mariadb-git-516f95acea961ed8e7c550ba49acdd884678058c.tar.gz |
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.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/partition_range.result | 22 | ||||
-rw-r--r-- | mysql-test/t/partition_range.test | 35 |
2 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index 4da79704ec3..4c6459a09e3 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,4 +1,26 @@ drop table if exists t1, t2; +create table t1 (a integer) +partition by range (a) +( partition p0 values less than (4), +partition p1 values less than (100)); +create trigger tr1 before insert on t1 +for each row begin +set @a = 1; +end| +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; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 6ed3abab46a..c73a56aff9d 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -10,6 +10,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 # #create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) |