1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

5.5 merge

This commit is contained in:
Sergei Golubchik
2014-03-26 22:25:38 +01:00
600 changed files with 129062 additions and 121039 deletions

View File

@ -729,5 +729,52 @@ GROUP BY 1, 2, 3;
DROP TABLE t1;
--echo #
--echo # MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703)
--echo #
create table t1 (
a int not null,
b int not null,
pk int not null,
primary key (pk),
key(a),
key(b)
) engine=innodb partition by hash(pk) partitions 10;
insert into t1 values (1,2,4); # both
insert into t1 values (1,0,17); # left
insert into t1 values (1,2,25); # both
insert into t1 values (10,20,122);
insert into t1 values (10,20,123);
# Now, fill in some data so that the optimizer choses index_merge
create table t2 (a int);
insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1 select 1,2, 200 + A.a + 10*B.a + 100*C.a from t2 A, t2 B, t2 C;
insert into t1 select 10+A.a + 10*B.a + 100*C.a + 1000*D.a,
10+A.a + 10*B.a + 100*C.a + 1000*D.a,
2000 + A.a + 10*B.a + 100*C.a + 1000*D.a
from t2 A, t2 B, t2 C ,t2 D;
# This should show index_merge, using intersect
--replace_column 9 #
explain select * from t1 where a=1 and b=2 and pk between 1 and 999999 ;
# 794 rows in output
create temporary table t3 as
select * from t1 where a=1 and b=2 and pk between 1 and 999 ;
select count(*) from t3;
drop table t3;
# 802 rows in output
create temporary table t3 as
select * from t1 ignore index(a,b) where a=1 and b=2 and pk between 1 and 999 ;
select count(*) from t3;
drop table t3;
drop table t1,t2;
set global default_storage_engine=default;