summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2009-02-18 20:05:39 +0100
committerMattias Jonsson <mattias.jonsson@sun.com>2009-02-18 20:05:39 +0100
commit1d8c5065b2394079238d19cc28e382691c88e175 (patch)
tree26e19bbea9d5545c0f595d37f47ebad75141e49c /mysql-test
parentc9245922d6dc5a7dedca24c160c0ae791d55aa69 (diff)
downloadmariadb-git-1d8c5065b2394079238d19cc28e382691c88e175.tar.gz
Bug#39338: Fieldnames in INFORMATIONSCHEMA.PARTITIONS.PARTITION_EXPRESSION
become unescaped Problem was only with the print out of the KEY partitioning list of fields, it did not include quotes, even if it was needed. Fixed by always add quotes if needed.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/partition.result37
-rw-r--r--mysql-test/t/partition.test23
2 files changed, 60 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 93684ba05e5..d13082fad55 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,5 +1,42 @@
drop table if exists t1, t2;
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 (
pk INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (pk)
)
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 6a12e4a4d12..aaf2ee7d4bd 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -15,6 +15,29 @@ drop table if exists t1, t2;
--enable_warnings
#
+# 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';
+show create table t1;
+drop table t1;
+
+#
# Bug#40954: Crash if range search and order by.
#
CREATE TABLE t1 (