Disabled ascii-function
This commit is contained in:
parent
c7f0c91012
commit
4ab5e26d93
@ -1,38 +1,8 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (a char(5) character set koi8r)
|
||||
partition by list (ascii(a) mod 3)
|
||||
subpartition by hash(ascii(a))
|
||||
subpartitions 3
|
||||
(partition p1 values in (1),
|
||||
partition p2 values in (2),
|
||||
partition p0 values in (0));
|
||||
insert into t1 values ('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 p2_p2sp2 system NULL NULL NULL NULL 1
|
||||
select * from t1 where a = 'a';
|
||||
a
|
||||
a
|
||||
drop table t1;
|
||||
create table t1 (a char(5) character set cp1251)
|
||||
partition by list (ascii(a)) (partition pn values in (null));
|
||||
drop table 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 (a char(5) character set big5)
|
||||
partition by list (ascii(a)) (partition pn values in (null));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
create table t1 (a char(1))
|
||||
partition by list(ascii(a))
|
||||
(partition p1 values in (ascii('i')));
|
||||
drop table t1;
|
||||
create table t1 (s1 char(5) character set latin5)
|
||||
partition by list (ascii(s1))
|
||||
(partition p1 values in (1));
|
||||
set names utf8;
|
||||
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));
|
||||
|
@ -19,6 +19,4 @@ drop table t1;
|
||||
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;
|
||||
ERROR HY000: This partition function is not allowed
|
||||
|
@ -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
|
||||
|
@ -676,24 +676,6 @@ f_int1 f_int2
|
||||
8 8
|
||||
9 9
|
||||
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';
|
||||
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
|
||||
(
|
||||
|
@ -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 (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;
|
||||
create table t1 (a int unsigned)
|
||||
partition by range (a)
|
||||
(partition pnull values less than (0),
|
||||
@ -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 (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;
|
||||
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 p0 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 p0 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 p0 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;
|
||||
|
@ -3,44 +3,11 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a char(5) character set koi8r)
|
||||
partition by list (ascii(a) mod 3)
|
||||
subpartition by hash(ascii(a))
|
||||
subpartitions 3
|
||||
(partition p1 values in (1),
|
||||
partition p2 values in (2),
|
||||
partition p0 values in (0));
|
||||
insert into t1 values ('a');
|
||||
explain partitions select * from t1 where a = 'a';
|
||||
select * from t1 where a = 'a';
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a char(5) character set cp1251)
|
||||
partition by list (ascii(a)) (partition pn values in (null));
|
||||
drop table 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;
|
||||
|
||||
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
||||
create table t1 (a char(5) character set big5)
|
||||
partition by list (ascii(a)) (partition pn values in (null));
|
||||
|
||||
create table t1 (a char(1))
|
||||
partition by list(ascii(a))
|
||||
(partition p1 values in (ascii('i')));
|
||||
#insert into t1 values ('i');
|
||||
drop table t1;
|
||||
|
||||
create table t1 (s1 char(5) character set latin5)
|
||||
partition by list (ascii(s1))
|
||||
(partition p1 values in (1));
|
||||
set names utf8;
|
||||
#insert into tn values ('¿¿');
|
||||
drop table t1;
|
||||
|
||||
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
|
||||
create table t1 (col1 int)
|
||||
partition by range(greatest(col1,10))
|
||||
|
@ -20,9 +20,10 @@ 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;
|
||||
#insert into t1 values ('A');
|
||||
#replace into t1 values ('A');
|
||||
#drop table t1;
|
||||
|
@ -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)
|
||||
|
@ -538,17 +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(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;
|
||||
#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"
|
||||
|
@ -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 (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 (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 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(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)
|
||||
#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 (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;
|
||||
#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 (ascii(a))
|
||||
(partition p0 values less than (100),
|
||||
partition p1 values less than maxvalue);
|
||||
#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;
|
||||
#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;
|
||||
|
@ -832,7 +832,6 @@ public:
|
||||
longlong val_int();
|
||||
const char *func_name() const { return "ascii"; }
|
||||
void fix_length_and_dec() { max_length=3; }
|
||||
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
|
||||
};
|
||||
|
||||
class Item_func_ord :public Item_int_func
|
||||
|
Loading…
x
Reference in New Issue
Block a user