mirror of
https://github.com/MariaDB/server.git
synced 2025-07-08 17:02:21 +03:00
Manual merge
mysql-test/r/partition.result: Auto merged sql/handler.h: Auto merged sql/item.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_select.cc: Auto merged
This commit is contained in:
@ -271,3 +271,10 @@ t1 CREATE TABLE `t1` (
|
||||
`b` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION x5 VALUES LESS THAN (12) ENGINE = MyISAM, PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM, PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM, PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM)
|
||||
drop table t1;
|
||||
create table t1 (a int not null, b int not null) partition by LIST (a+b) (
|
||||
partition p0 values in (12),
|
||||
partition p1 values in (14)
|
||||
);
|
||||
insert into t1 values (10,1);
|
||||
ERROR HY000: Table has no partition for value 11
|
||||
drop table t1;
|
||||
|
@ -259,3 +259,48 @@ explain partitions select * from t1 where a is not null;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
|
||||
drop table t1;
|
||||
create table t1 (a int not null, b int not null, key(a), key(b))
|
||||
partition by hash(a) partitions 4;
|
||||
insert into t1 values (1,1),(2,2),(3,3),(4,4);
|
||||
explain partitions
|
||||
select * from t1 X, t1 Y
|
||||
where X.b = Y.b and (X.a=1 or X.a=2) and (Y.a=2 or Y.a=3);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE X p1,p2 ALL a,b NULL NULL NULL 4 Using where
|
||||
1 SIMPLE Y p2,p3 ref a,b b 4 test.X.b 2 Using where
|
||||
explain partitions
|
||||
select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE X p1,p2 ALL a NULL NULL NULL 4 Using where
|
||||
1 SIMPLE Y p1,p2 ref a a 4 test.X.a 2
|
||||
drop table t1;
|
||||
create table t1 (a int) partition by hash(a) partitions 20;
|
||||
insert into t1 values (1),(2),(3);
|
||||
explain partitions select * from t1 where a > 1 and a < 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t1 where a >= 1 and a < 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t1 where a > 1 and a <= 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2,p3 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t1 where a >= 1 and a <= 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by list(a) subpartition by hash(b) subpartitions 20
|
||||
(
|
||||
partition p0 values in (0),
|
||||
partition p1 values in (1),
|
||||
partition p2 values in (2),
|
||||
partition p3 values in (3)
|
||||
);
|
||||
insert into t1 values (1,1),(2,2),(3,3);
|
||||
explain partitions select * from t1 where b > 1 and b < 3;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0_sp2,p1_sp2,p2_sp2,p3_sp2 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t1 where b > 1 and b < 3 and (a =1 or a =2);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1_sp2,p2_sp2 ALL NULL NULL NULL NULL 3 Using where
|
||||
|
Reference in New Issue
Block a user