List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:August 11 2009 5:51pm
Subject:bzr push into mysql-pe branch (alik:3525 to 3526) Bug#46198
View as plain text  
 3526 Alexander Nozdrin	2009-08-11
      A test case for Bug#46198 (Hang after failed ALTER TABLE on partitioned table).

    modified:
      mysql-test/r/partition.result
      mysql-test/t/partition.test
 3525 Davi Arnaut	2009-08-11 [merge]
      Automerge.

    modified:
      mysql-test/r/view.result
      mysql-test/t/view.test
=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2009-08-06 12:41:22 +0000
+++ b/mysql-test/r/partition.result	2009-08-11 17:51:41 +0000
@@ -2087,4 +2087,24 @@ SELECT  1 FROM t1 JOIN t1 AS t2 USING (a
 1
 1
 DROP TABLE t1;
+#
+# Bug#46198: Hang after failed ALTER TABLE on partitioned table.
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (s1 INT PRIMARY KEY) PARTITION BY HASH(s1);
+LOCK TABLES t1 WRITE, t1 b READ;
+UNLOCK TABLES;
+ALTER TABLE t1 DROP PARTITION p1;
+ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions
+SELECT * FROM t1;
+s1
+DROP TABLE t1;
+CREATE TABLE t1 (s1 VARCHAR(5) PRIMARY KEY) PARTITION BY KEY(s1);
+LOCK TABLES t1 WRITE, t1 b READ;
+UNLOCK TABLES;
+ALTER TABLE t1 ADD COLUMN (s3 VARCHAR(5) UNIQUE);
+ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
+SELECT * FROM t1;
+s1
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test	2009-08-06 12:41:22 +0000
+++ b/mysql-test/t/partition.test	2009-08-11 17:51:41 +0000
@@ -2080,4 +2080,50 @@ INSERT INTO t1 VALUES (6,8,10);
 SELECT  1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
 
 DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#46198: Hang after failed ALTER TABLE on partitioned table.
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+#
+# Case 1.
+#
+
+CREATE TABLE t1 (s1 INT PRIMARY KEY) PARTITION BY HASH(s1);
+
+LOCK TABLES t1 WRITE, t1 b READ;
+
+UNLOCK TABLES;
+
+--error ER_ONLY_ON_RANGE_LIST_PARTITION
+ALTER TABLE t1 DROP PARTITION p1;
+
+# The SELECT below used to hang in tdc_wait_for_old_versions().
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+#
+# Case 2.
+#
+
+CREATE TABLE t1 (s1 VARCHAR(5) PRIMARY KEY) PARTITION BY KEY(s1);
+
+LOCK TABLES t1 WRITE, t1 b READ;
+
+UNLOCK TABLES;
+
+--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
+ALTER TABLE t1 ADD COLUMN (s3 VARCHAR(5) UNIQUE);
+
+# The SELECT below used to hang in tdc_wait_for_old_versions().
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
 --echo End of 5.1 tests


Attachment: [text/bzr-bundle] bzr/alik@sun.com-20090811175141-oopyqw7fkz20kecx.bundle
Thread
bzr push into mysql-pe branch (alik:3525 to 3526) Bug#46198Alexander Nozdrin11 Aug