diff options
author | unknown <mikael@dator6.(none)> | 2007-07-02 18:08:27 +0200 |
---|---|---|
committer | unknown <mikael@dator6.(none)> | 2007-07-02 18:08:27 +0200 |
commit | a80b1ba2c9c29469256b77ccb69df0639cc6e9a3 (patch) | |
tree | e967f9a5da2ff39c5f23a3272586e2f6c0f55829 /mysql-test | |
parent | de0ba5c894df8f86512d025f4196d62687efb1bb (diff) | |
parent | ff3f8990e74e8133fb68bea7b85a60b055c9feb9 (diff) | |
download | mariadb-git-a80b1ba2c9c29469256b77ccb69df0639cc6e9a3.tar.gz |
Merge dator6.(none):/home/mikael/mysql_clones/mysql-5.1-opt
into dator6.(none):/home/mikael/mysql_clones/bug18198
mysql-test/t/partition_hash.test:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/partition_bug18198.result | 173 | ||||
-rw-r--r-- | mysql-test/r/partition_charset.result | 4 | ||||
-rw-r--r-- | mysql-test/r/partition_error.result | 10 | ||||
-rw-r--r-- | mysql-test/r/partition_hash.result | 14 | ||||
-rw-r--r-- | mysql-test/r/partition_list.result | 4 | ||||
-rw-r--r-- | mysql-test/r/partition_mgm.result | 6 | ||||
-rw-r--r-- | mysql-test/r/partition_pruning.result | 66 | ||||
-rw-r--r-- | mysql-test/r/partition_range.result | 78 | ||||
-rw-r--r-- | mysql-test/t/partition_bug18198.test | 219 | ||||
-rw-r--r-- | mysql-test/t/partition_charset.test | 8 | ||||
-rw-r--r-- | mysql-test/t/partition_error.test | 11 | ||||
-rw-r--r-- | mysql-test/t/partition_hash.test | 12 | ||||
-rw-r--r-- | mysql-test/t/partition_list.test | 4 | ||||
-rw-r--r-- | mysql-test/t/partition_mgm.test | 2 | ||||
-rw-r--r-- | mysql-test/t/partition_pruning.test | 68 | ||||
-rw-r--r-- | mysql-test/t/partition_range.test | 128 |
16 files changed, 579 insertions, 228 deletions
diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result new file mode 100644 index 00000000000..18d7d904bb0 --- /dev/null +++ b/mysql-test/r/partition_bug18198.result @@ -0,0 +1,173 @@ +drop table if exists t1; +create table t1 (col1 datetime) +partition by range(datediff(col1,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +drop table t1; +create table t1 (col1 int) +partition by range(greatest(col1,10)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(isnull(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(least(col1,12)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(case when col1>0 then 10 else 20 end) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(ifnull(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(nullif(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(character_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(find_in_set(col1,1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(find_in_set(col1,'1')) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(instr(col1,3)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(instr(col1,'3')) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(octet_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(crc32(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(round(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(sign(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime) +partition by range(period_add(col1,5)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime, col2 datetime) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int, col2 int) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime) +partition by range(timestampdiff(day,5,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 date) +partition by range(unix_timestamp(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime) +partition by range(week(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 varchar(25)) +partition by range(cast(col1 as signed)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 varchar(25)) +partition by range(convert(col1,unsigned)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 | 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 & 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 ^ 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 << 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 >> 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(~col1) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(bit_count(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(inet_aton(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/r/partition_charset.result b/mysql-test/r/partition_charset.result index 665e5d55f8f..f8f75e8bee7 100644 --- a/mysql-test/r/partition_charset.result +++ b/mysql-test/r/partition_charset.result @@ -16,3 +16,7 @@ s1 1 3 drop table t1; +create table t1 (a varchar(1), primary key (a)) +partition by list (ascii(a)) +(partition p1 values in (65)); +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 4b01b759902..7952c8df609 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -25,7 +25,7 @@ partitions 3 (partition x1 values in (1,2,9,4) tablespace ts1, partition x2 values in (3, 11, 5, 7) tablespace ts2, partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed CREATE TABLE t1 ( a int not null, b int not null, @@ -89,7 +89,7 @@ partitions 3 (partition x1 tablespace ts1, partition x2 tablespace ts2, partition x3 tablespace ts3); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed CREATE TABLE t1 ( a int not null, b int not null, @@ -422,7 +422,7 @@ partition by range (sin(a)) partitions 2 (partition x1 values less than (4), partition x2 values less than (5)); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed CREATE TABLE t1 ( a int not null, b int not null, @@ -600,7 +600,7 @@ ERROR HY000: Partition constant is out of partition function domain create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); -drop table t1; +ERROR HY000: This partition function is not allowed create table t1 (a int) partition by hash (rand(a)); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 @@ -619,4 +619,4 @@ partition by range (a + (select count(*) from t1)) ERROR HY000: This partition function is not allowed create table t1 (a char(10)) partition by hash (extractvalue(a,'a')); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result index 7ef3ee5c6c8..9a82a36d902 100644 --- a/mysql-test/r/partition_hash.result +++ b/mysql-test/r/partition_hash.result @@ -1,18 +1,4 @@ drop table if exists t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin) -partition by hash(length(a)) -partitions 10; -insert into t1 values (''),(' '),('a'),('a '),('a '); -explain partitions select * from t1 where a='a '; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a='a'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a='a ' OR a='a'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -drop table t1; create table t1 (a int unsigned) partition by hash(a div 2) partitions 4; diff --git a/mysql-test/r/partition_list.result b/mysql-test/r/partition_list.result index e64a7a8d154..a68a67c6386 100644 --- a/mysql-test/r/partition_list.result +++ b/mysql-test/r/partition_list.result @@ -295,3 +295,7 @@ select * from t1; a 100 drop table t1; +create table t1 (a char(1)) +partition by list (ascii(ucase(a))) +(partition p1 values in (2)); +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result index 9b5a34bda50..04ac603fea7 100644 --- a/mysql-test/r/partition_mgm.result +++ b/mysql-test/r/partition_mgm.result @@ -10,13 +10,13 @@ subpartition sp01, subpartition sp02)); ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting drop table t1; CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) -PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2; +PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */ hello/master-data/test/t1#P#p0.MYD hello/master-data/test/t1#P#p0.MYI hello/master-data/test/t1#P#p1.MYD @@ -29,7 +29,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 1 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */ hello/master-data/test/t1#P#p0.MYD hello/master-data/test/t1#P#p0.MYI hello/master-data/test/t1.frm diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 5fc0058356d..9595676016c 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -676,25 +676,6 @@ f_int1 f_int2 8 8 9 9 drop table t1; -create table t1 (a char(10) binary) -partition by list(length(a)) -(partition p1 values in (1), -partition p2 values in (2), -partition p3 values in (3), -partition p4 values in (4), -partition p5 values in (5) -); -insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); -select * from t1 where a>='a' and a <= 'dddd'; -a -a -bb -ccc -dddd -explain partitions select * from t1 where a>='a' and a <= 'dddd'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where -drop table t1; create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2))) subpartition by hash(f_int1) subpartitions 2 ( @@ -847,23 +828,58 @@ explain partitions select * from t1 where a = 18446744073709551614; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; -create table t1 (a int) -partition by range((a & 0xFF) << 56) ( -partition p0 values less than (0x40 << 56), -partition p1 values less than (0x80 << 56), -partition p2 values less than (0xFF << 56) +create table t1 (a int) +partition by range(a) ( +partition p0 values less than (64), +partition p1 values less than (128), +partition p2 values less than (255) +); +create table t2 (a int) +partition by range(a+0) ( +partition p0 values less than (64), +partition p1 values less than (128), +partition p2 values less than (255) ); insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); explain partitions select * from t1 where a=0; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t2 where a=0; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a=0xFE; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where -explain partitions select * from t1 where a>0xFE and a<= 0xFF; +explain partitions select * from t2 where a=0xFE; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t1 where a > 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +explain partitions select * from t2 where a > 0xFE AND a <= 0xFF; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t1 where a < 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t2 where a < 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t1 where a <= 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where +explain partitions select * from t2 where a <= 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 4 Using where drop table t1; +drop table t2; create table t1(a bigint unsigned not null) partition by range(a+0) ( partition p1 values less than (10), partition p2 values less than (20), diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index d39b39f413a..a61006e87a4 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,38 +1,4 @@ drop table if exists t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(b) * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(a) * length(b)) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (length(a) * c) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), @@ -109,7 +75,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; CREATE TABLE t1 ( a int not null, @@ -743,45 +709,3 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where DROP TABLE t1; -create table t1 (a varchar(20)) -partition by range (crc32(md5(a))) -(partition p0 values less than (100), -partition p1 values less than maxvalue); -insert into t1 values ("12345678901234567890"); -insert into t1 values ("A2345678901234567890"); -insert into t1 values ("B2345678901234567890"); -insert into t1 values ("1234567890123456789"); -insert into t1 values ("1234567890123456"); -select * from t1; -a -12345678901234567890 -A2345678901234567890 -B2345678901234567890 -1234567890123456789 -1234567890123456 -explain partitions select * from t1 where a = "12345678901234567890"; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a = "12345678901234567890" OR -a = "A2345678901234567890" OR -a = "B2345678901234567890" OR -a = "C2345678901234567890"; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a = "01234567890123456"; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where -select * from t1 where a = "01234567890123456"; -a -select * from t1 where a = "12345678901234567890" OR -a = "A2345678901234567890" OR -a = "B2345678901234567890" OR -a = "C2345678901234567890"; -a -12345678901234567890 -A2345678901234567890 -B2345678901234567890 -select * from t1 where a = "12345678901234567890"; -a -12345678901234567890 -drop table t1; diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test new file mode 100644 index 00000000000..7f071c6ec9e --- /dev/null +++ b/mysql-test/t/partition_bug18198.test @@ -0,0 +1,219 @@ +-- source include/have_partition.inc +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (col1 datetime) +partition by range(datediff(col1,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +drop table t1; + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(greatest(col1,10)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(isnull(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(least(col1,12)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(case when col1>0 then 10 else 20 end) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(ifnull(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(nullif(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(character_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(find_in_set(col1,1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(find_in_set(col1,'1')) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(instr(col1,3)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(instr(col1,'3')) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(octet_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(crc32(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(round(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(sign(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime) +partition by range(period_add(col1,5)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime, col2 datetime) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int, col2 int) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime) +partition by range(timestampdiff(day,5,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 date) +partition by range(unix_timestamp(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime) +partition by range(week(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 varchar(25)) +partition by range(cast(col1 as signed)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 varchar(25)) +partition by range(convert(col1,unsigned)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 | 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 & 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 ^ 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 << 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 >> 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(~col1) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(bit_count(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(inet_aton(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); diff --git a/mysql-test/t/partition_charset.test b/mysql-test/t/partition_charset.test index 27d0dc87b89..6842e5268fa 100644 --- a/mysql-test/t/partition_charset.test +++ b/mysql-test/t/partition_charset.test @@ -19,3 +19,11 @@ flush tables; set names latin1; select * from t1; drop table t1; + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (a varchar(1), primary key (a)) +partition by list (ascii(a)) +(partition p1 values in (65)); +#insert into t1 values ('A'); +#replace into t1 values ('A'); +#drop table t1; diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 20703b979f1..5fc2097cc52 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -33,7 +33,7 @@ partitions 2; # # Partition by key list, wrong result type # ---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, @@ -109,7 +109,7 @@ partitions 3 # # Partition by hash, invalid result type # ---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, @@ -533,7 +533,7 @@ partitions 2 # # Partition by range, wrong result type of partition function # ---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, @@ -769,10 +769,11 @@ partition by range (a) # # Bug 18198 Partitions: Verify that erroneus partition functions doesn't work # +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); -drop table t1; +#drop table t1; -- error 1064 create table t1 (a int) @@ -790,7 +791,7 @@ partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00'))); create table t1 (a int) partition by range (a + (select count(*) from t1)) (partition p1 values less than (1)); --- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (a char(10)) partition by hash (extractvalue(a,'a')); diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test index ca7972cc01c..98add060a76 100644 --- a/mysql-test/t/partition_hash.test +++ b/mysql-test/t/partition_hash.test @@ -10,18 +10,6 @@ drop table if exists t1; --enable_warnings # -# BUG 18198: Partition functions handling -# -create table t1 (a varchar(10) charset latin1 collate latin1_bin) -partition by hash(length(a)) -partitions 10; -insert into t1 values (''),(' '),('a'),('a '),('a '); -explain partitions select * from t1 where a='a '; -explain partitions select * from t1 where a='a'; -explain partitions select * from t1 where a='a ' OR a='a'; -drop table t1; - -# # More partition pruning tests, especially on interval walking # create table t1 (a int unsigned) diff --git a/mysql-test/t/partition_list.test b/mysql-test/t/partition_list.test index 1e420cfe6ed..1c76de9d55a 100644 --- a/mysql-test/t/partition_list.test +++ b/mysql-test/t/partition_list.test @@ -179,4 +179,8 @@ insert into t1 values (null); select * from t1; drop table t1; +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (a char(1)) +partition by list (ascii(ucase(a))) +(partition p1 values in (2)); diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test index 8458d47d634..a06f8d1aee5 100644 --- a/mysql-test/t/partition_mgm.test +++ b/mysql-test/t/partition_mgm.test @@ -20,7 +20,7 @@ subpartition sp01, subpartition sp02)); drop table t1; CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) -PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2; +PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2; SHOW CREATE TABLE t1; --replace_result $MYSQLTEST_VARDIR "hello" diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index a60846f18ff..12951c9232a 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -538,18 +538,17 @@ select * from t1 where f_int1 between 5 and 15 order by f_int1; drop table t1; # part2: bug in pruning code -create table t1 (a char(10) binary) -partition by list(length(a)) - (partition p1 values in (1), - partition p2 values in (2), - partition p3 values in (3), - partition p4 values in (4), - partition p5 values in (5) -); -insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); -select * from t1 where a>='a' and a <= 'dddd'; -explain partitions select * from t1 where a>='a' and a <= 'dddd'; -drop table t1; +#create table t1 (a char(10) binary) +#partition by list(ascii(a)) +# (partition p1 values in (ascii('a')), +# partition p2 values in (ascii('b')), +# partition p3 values in (ascii('c')), +# partition p4 values in (ascii('d')), +# partition p5 values in (ascii('e'))); +#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); +#select * from t1 where a>='a' and a <= 'dddd'; +#explain partitions select * from t1 where a>='a' and a <= 'dddd'; +#drop table t1; # BUG#18659: Assertion failure when subpartitioning is used and partition is # "IS NULL" @@ -692,20 +691,47 @@ explain partitions select * from t1 where a = 18446744073709551000; explain partitions select * from t1 where a = 18446744073709551613; explain partitions select * from t1 where a = 18446744073709551614; drop table t1; - -create table t1 (a int) - partition by range((a & 0xFF) << 56) ( - partition p0 values less than (0x40 << 56), - partition p1 values less than (0x80 << 56), - partition p2 values less than (0xFF << 56) +# +# Test all variants of usage for interval_via_mapping +# and interval_via_walking +# +# t1 will use interval_via_mapping since it uses a +# monotonic function, whereas t2 will use +# interval_via_walking since the intervals are short +# and the function isn't monotonic (it is, but it isn't +# discovered in this version). +# + create table t1 (a int) + partition by range(a) ( + partition p0 values less than (64), + partition p1 values less than (128), + partition p2 values less than (255) ); -insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +create table t2 (a int) + partition by range(a+0) ( + partition p0 values less than (64), + partition p1 values less than (128), + partition p2 values less than (255) +); + +insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); explain partitions select * from t1 where a=0; +explain partitions select * from t2 where a=0; explain partitions select * from t1 where a=0xFE; -explain partitions select * from t1 where a>0xFE and a<= 0xFF; +explain partitions select * from t2 where a=0xFE; +explain partitions select * from t1 where a > 0xFE AND a <= 0xFF; +explain partitions select * from t2 where a > 0xFE AND a <= 0xFF; +explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF; +explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF; +explain partitions select * from t1 where a < 64 AND a >= 63; +explain partitions select * from t2 where a < 64 AND a >= 63; +explain partitions select * from t1 where a <= 64 AND a >= 63; +explain partitions select * from t2 where a <= 64 AND a >= 63; drop table t1; - +drop table t2; + create table t1(a bigint unsigned not null) partition by range(a+0) ( partition p1 values less than (10), partition p2 values less than (20), diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 84f67febe8b..50d850913bc 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -12,45 +12,45 @@ drop table if exists t1; # # BUG 18198: Various tests for partition functions # -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(b) * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(a) * length(b)) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (length(a) * c) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) +#partition by range (ascii(a) * b) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 2),('a',3); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) +#partition by range (b* ascii(a) * b) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 2),('a',3); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin) +#partition by range (ascii(b) * ascii(a)) +#(partition p0 values less than (2), partition p1 values less than (40000)); +#insert into t1 values ('a ', 'b '),('a','b'); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin) +#partition by range (ascii(a) * ascii(b)) +#(partition p0 values less than (2), partition p1 values less than (40000)); +#insert into t1 values ('a ', 'b '),('a','b'); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin, c int) +#partition by range (ascii(a) * c) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 'b ', 2),('a','b', 3); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin, c int) +#partition by range (c * ascii(a)) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 'b ', 2),('a','b', 3); +#drop table t1; # # More checks for partition pruning @@ -733,29 +733,27 @@ DROP TABLE t1; # # Bug 18198: Try with a couple of cases using VARCHAR fields in # partition function. -create table t1 (a varchar(20)) -partition by range (crc32(md5(a))) -(partition p0 values less than (100), - partition p1 values less than maxvalue); - -insert into t1 values ("12345678901234567890"); -insert into t1 values ("A2345678901234567890"); -insert into t1 values ("B2345678901234567890"); -insert into t1 values ("1234567890123456789"); -insert into t1 values ("1234567890123456"); -select * from t1; -explain partitions select * from t1 where a = "12345678901234567890"; -explain partitions select * from t1 where a = "12345678901234567890" OR - a = "A2345678901234567890" OR - a = "B2345678901234567890" OR - a = "C2345678901234567890"; -explain partitions select * from t1 where a = "01234567890123456"; -select * from t1 where a = "01234567890123456"; -select * from t1 where a = "12345678901234567890" OR - a = "A2345678901234567890" OR - a = "B2345678901234567890" OR - a = "C2345678901234567890"; -select * from t1 where a = "12345678901234567890"; - - -drop table t1; +#create table t1 (a varchar(20)) +#partition by range (ascii(a)) +#(partition p0 values less than (100), +# partition p1 values less than maxvalue); + +#insert into t1 values ("12345678901234567890"); +#insert into t1 values ("A2345678901234567890"); +#insert into t1 values ("B2345678901234567890"); +#insert into t1 values ("1234567890123456789"); +#insert into t1 values ("1234567890123456"); +#select * from t1; +#explain partitions select * from t1 where a = "12345678901234567890"; +#explain partitions select * from t1 where a = "12345678901234567890" OR +# a = "A2345678901234567890" OR +# a = "B2345678901234567890" OR +# a = "C2345678901234567890"; +#explain partitions select * from t1 where a = "01234567890123456"; +#select * from t1 where a = "01234567890123456"; +#select * from t1 where a = "12345678901234567890" OR +# a = "A2345678901234567890" OR +# a = "B2345678901234567890" OR +# a = "C2345678901234567890"; +#select * from t1 where a = "12345678901234567890"; +#drop table t1; |