summaryrefslogtreecommitdiff
path: root/mysql-test/r/partition.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/partition.result')
-rw-r--r--mysql-test/r/partition.result73
1 files changed, 73 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 9aa2dd418f8..55366bd2e07 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,4 +1,46 @@
drop table if exists t1, t2;
+# Bug#39338: Fieldnames in
+# INFORMATIONSCHEMA.PARTITIONS.PARTITION_EXPRESSION become unescaped
+# NOTE: the partition expression is saved as a string, so changing from
+# normal quotes to ansi quotes does not change the expression, only
+# for partition by KEY.
+CREATE TABLE t1 (
+ID int(11) NOT NULL,
+`aaaa,aaaaa` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
+ddddddddd int(11) NOT NULL DEFAULT '0',
+new_field0 varchar(50),
+PRIMARY KEY(ID, `aaaa,aaaaa`, ddddddddd))
+PARTITION BY RANGE(ID)
+PARTITIONS 3
+SUBPARTITION BY LINEAR KEY(ID,`aaaa,aaaaa`)
+SUBPARTITIONS 2 (
+PARTITION p01 VALUES LESS THAN(100),
+PARTITION p11 VALUES LESS THAN(200),
+PARTITION p21 VALUES LESS THAN MAXVALUE);
+SELECT PARTITION_EXPRESSION, SUBPARTITION_EXPRESSION FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1';
+PARTITION_EXPRESSION SUBPARTITION_EXPRESSION
+ID `ID`,`aaaa,aaaaa`
+ID `ID`,`aaaa,aaaaa`
+ID `ID`,`aaaa,aaaaa`
+ID `ID`,`aaaa,aaaaa`
+ID `ID`,`aaaa,aaaaa`
+ID `ID`,`aaaa,aaaaa`
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ID` int(11) NOT NULL,
+ `aaaa,aaaaa` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `ddddddddd` int(11) NOT NULL DEFAULT '0',
+ `new_field0` varchar(50) DEFAULT NULL,
+ PRIMARY KEY (`ID`,`aaaa,aaaaa`,`ddddddddd`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE (ID)
+SUBPARTITION BY LINEAR KEY (ID,`aaaa,aaaaa`)
+SUBPARTITIONS 2
+(PARTITION p01 VALUES LESS THAN (100) ENGINE = MyISAM,
+ PARTITION p11 VALUES LESS THAN (200) ENGINE = MyISAM,
+ PARTITION p21 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+drop table t1;
CREATE TABLE t1 (a INT, b INT)
PARTITION BY LIST (a)
SUBPARTITION BY HASH (b)
@@ -2111,4 +2153,35 @@ COUNT(*)
0
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
+#
+# 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;
+#
+# BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables
+#
+SET GLOBAL myisam_use_mmap=1;
+CREATE TABLE t1(a INT) PARTITION BY HASH(a) PARTITIONS 1;
+INSERT INTO t1 VALUES(0);
+FLUSH TABLE t1;
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES(0);
+DROP TABLE t1;
+SET GLOBAL myisam_use_mmap=default;
End of 5.1 tests