summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2010-05-25 17:41:11 +0200
committerMattias Jonsson <mattias.jonsson@sun.com>2010-05-25 17:41:11 +0200
commit8db43e66acbc065ee0b63902d31ede42d9afc8e0 (patch)
tree3ee70f23075cab044c169c9472ebe1944f341f15 /mysql-test
parent2abf030a127556560e1c206132a62ae514123c83 (diff)
parentd347714d939c574520fcb73cef57f331b02fbe53 (diff)
downloadmariadb-git-8db43e66acbc065ee0b63902d31ede42d9afc8e0.tar.gz
merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/partition.result42
-rw-r--r--mysql-test/t/partition.test22
2 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 77c1778fc55..66f8ac68dfe 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)
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 4b7be00148f..bcb5d4b5d92 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -14,6 +14,28 @@
drop table if exists t1, t2;
--enable_warnings
+--echo # Bug#39338: Fieldnames in
+--echo # INFORMATIONSCHEMA.PARTITIONS.PARTITION_EXPRESSION become unescaped
+--echo # NOTE: the partition expression is saved as a string, so changing from
+--echo # normal quotes to ansi quotes does not change the expression, only
+--echo # 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';
+show create table t1;
+drop table t1;
+
#
# Bug#48276: can't add column if subpartition exists
CREATE TABLE t1 (a INT, b INT)