Description:
Set sql_mode is ANSI_QUOTES, and then create a table with partition_options maybe cause a problem that PARTITION_EXPRESSION and SUBPARTITION_EXPRESSION in information_schema.partitions are wrapped in double quotes.
How to repeat:
(1)set sql_mode = ANSI_QUOTES;
(2)create database mydb_test;
(3)
create table mydb_test.t30 (a int, b char(10), c varchar(5), d int)
partition by range columns(a,b,c)
subpartition by key (c,d)
subpartitions 3
( partition p0 values less than (1,'abc','abc'),
partition p1 values less than (2,'abc','abc'),
partition p2 values less than (3,'abc','abc'),
partition p3 values less than (4,'abc','abc'));
(4)
mysql> select PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION from information_schema.partitions where TABLE_SCHEMA = 'mydb_test' and TABLE_NAME = 't30';
+----------------------+-------------------------+
| PARTITION_EXPRESSION | SUBPARTITION_EXPRESSION |
+----------------------+-------------------------+
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
+----------------------+-------------------------+
12 rows in set (0.01 sec)
(5)set sql_mode = STRICT_TRANS_TABLES;
(6)
mysql> select PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION from information_schema.partitions where TABLE_SCHEMA = 'mydb_test' and TABLE_NAME = 't30';
+----------------------+-------------------------+
| PARTITION_EXPRESSION | SUBPARTITION_EXPRESSION |
+----------------------+-------------------------+
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
| "a","b","c" | "c","d" |
+----------------------+-------------------------+
12 rows in set (0.01 sec)
Suggested fix:
Print PARTITION_EXPRESSION and SUBPARTITION_EXPRESSION as an identifier enclosed with "`" instead of double quotes.