mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
#2968 test cases for mysql joins with clustering keys refs[t:2968]
git-svn-id: file:///svn/mysql/tests/mysql-test@24775 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
09e849c671
commit
c2540622ad
6 changed files with 3516 additions and 0 deletions
1115
mysql-test/suite/tokudb.cluster/r/2968-1.result
Normal file
1115
mysql-test/suite/tokudb.cluster/r/2968-1.result
Normal file
File diff suppressed because it is too large
Load diff
1119
mysql-test/suite/tokudb.cluster/r/2968-2.result
Normal file
1119
mysql-test/suite/tokudb.cluster/r/2968-2.result
Normal file
File diff suppressed because it is too large
Load diff
1101
mysql-test/suite/tokudb.cluster/r/2968-3.result
Normal file
1101
mysql-test/suite/tokudb.cluster/r/2968-3.result
Normal file
File diff suppressed because it is too large
Load diff
61
mysql-test/suite/tokudb.cluster/t/2968-1.test
Normal file
61
mysql-test/suite/tokudb.cluster/t/2968-1.test
Normal file
|
@ -0,0 +1,61 @@
|
|||
# test that the query planner picks clustering keys for joins
|
||||
|
||||
# create table s
|
||||
drop table if exists s;
|
||||
create table s (a int, b int, c int) engine=tokudb;
|
||||
|
||||
# populate table s
|
||||
let $a = 10;
|
||||
while ($a) {
|
||||
let $b = 10;
|
||||
while ($b) {
|
||||
let $c = 10;
|
||||
while ($c) {
|
||||
eval insert into s values ($a,$b,$c);
|
||||
dec $c;
|
||||
}
|
||||
dec $b;
|
||||
}
|
||||
dec $a;
|
||||
}
|
||||
|
||||
# create table t
|
||||
drop table if exists t;
|
||||
create table t like s;
|
||||
insert into t select * from s;
|
||||
|
||||
# join with no keys
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join * from s,t where s.b = t.b;
|
||||
|
||||
# join with uncovered keys
|
||||
alter table s add key(b);
|
||||
alter table t add key(b);
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join * from s,t where s.b = t.b;
|
||||
|
||||
# join with uncovered keys and clustering keys
|
||||
alter table s add clustering key(b);
|
||||
alter table t add clustering key(b);
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join * from s,t where s.b = t.b;
|
||||
|
||||
# join with clustering keys
|
||||
alter table s drop key b;
|
||||
alter table t drop key b;
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join * from s,t where s.b = t.b;
|
||||
|
||||
# put the uncovered keys back
|
||||
alter table s add key(b);
|
||||
alter table t add key(b);
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join * from s,t where s.b = t.b;
|
||||
|
||||
|
||||
|
63
mysql-test/suite/tokudb.cluster/t/2968-2.test
Normal file
63
mysql-test/suite/tokudb.cluster/t/2968-2.test
Normal file
|
@ -0,0 +1,63 @@
|
|||
# test that the query planner picks clustering keys for joins
|
||||
|
||||
# create table s
|
||||
drop table if exists s;
|
||||
create table s (a int, b int, c int) engine=tokudb;
|
||||
|
||||
# populate table s
|
||||
let $a = 10;
|
||||
while ($a) {
|
||||
let $b = 10;
|
||||
while ($b) {
|
||||
let $c = 10;
|
||||
while ($c) {
|
||||
eval insert into s values ($a,$b,$c);
|
||||
dec $c;
|
||||
}
|
||||
dec $b;
|
||||
}
|
||||
dec $a;
|
||||
}
|
||||
|
||||
# create table t
|
||||
drop table if exists t;
|
||||
create table t like s;
|
||||
insert into t select * from s;
|
||||
|
||||
# join with no keys
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join s.a,t.a from s,t where s.b = t.b;
|
||||
|
||||
# join with uncovered keys
|
||||
alter table s add key(b);
|
||||
alter table t add key(b);
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join s.a,t.a from s,t where s.b = t.b;
|
||||
|
||||
# join with uncovered keys and covering keys
|
||||
# should pick the covering keys
|
||||
alter table s add key(b,a);
|
||||
alter table t add key(b,a);
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join s.a,t.a from s,t where s.b = t.b;
|
||||
|
||||
# join with uncovered keys, covering keys and clustering keys
|
||||
# should pick the covering keys
|
||||
alter table s add clustering key(b);
|
||||
alter table t add clustering key(b);
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join s.a,t.a from s,t where s.b = t.b;
|
||||
|
||||
# join with uncovered keys and clustering keys
|
||||
# should pick the clustering keys
|
||||
alter table s drop key b_2;
|
||||
alter table t drop key b_2;
|
||||
show create table s;
|
||||
show create table t;
|
||||
explain select straight_join s.a,t.a from s,t where s.b = t.b;
|
||||
|
||||
|
57
mysql-test/suite/tokudb.cluster/t/2968-3.test
Normal file
57
mysql-test/suite/tokudb.cluster/t/2968-3.test
Normal file
|
@ -0,0 +1,57 @@
|
|||
# test that the query planner picks clustering keys for 3 table joins
|
||||
|
||||
# create table s
|
||||
drop table if exists s;
|
||||
create table s (a int, b int, c int) engine=tokudb;
|
||||
|
||||
# populate table s
|
||||
let $a = 10;
|
||||
while ($a) {
|
||||
let $b = 10;
|
||||
while ($b) {
|
||||
let $c = 10;
|
||||
while ($c) {
|
||||
eval insert into s values ($a,$b,$c);
|
||||
dec $c;
|
||||
}
|
||||
dec $b;
|
||||
}
|
||||
dec $a;
|
||||
}
|
||||
|
||||
# create table t
|
||||
drop table if exists t;
|
||||
create table t like s;
|
||||
insert into t select * from s;
|
||||
|
||||
# create table u;
|
||||
drop table if exists u;
|
||||
create table u like s;
|
||||
insert into u select * from s;
|
||||
|
||||
# join with no keys
|
||||
show create table s;
|
||||
show create table t;
|
||||
show create table u;
|
||||
explain select straight_join * from s,t,u where s.b = t.b and s.c = t.c;
|
||||
|
||||
# join with uncovered keys
|
||||
alter table s add key (b);
|
||||
alter table t add key (b);
|
||||
alter table u add key (c);
|
||||
show create table s;
|
||||
show create table t;
|
||||
show create table u;
|
||||
explain select straight_join * from s,t,u where s.b = t.b and s.c = u.c;
|
||||
|
||||
# join with clustering keys
|
||||
alter table s add clustering key (b);
|
||||
alter table t add clustering key (b);
|
||||
alter table u add clustering key (c);
|
||||
show create table s;
|
||||
show create table t;
|
||||
show create table u;
|
||||
explain select straight_join * from s,t,u where s.b = t.b and s.c = u.c;
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue