summaryrefslogtreecommitdiff
path: root/storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-09-09 13:59:38 +0200
committerSergei Golubchik <sergii@pisem.net>2013-09-09 13:59:38 +0200
commit9a3b9a541659f9d2637614df417a39d5508abeaa (patch)
tree5df6de4ffdeae387d6610f8b8462ca292b97cd7a /storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test
parentd29f874db18068926ee899c532b25d0c8872f5dd (diff)
downloadmariadb-git-9a3b9a541659f9d2637614df417a39d5508abeaa.tar.gz
tokudb test suites
Diffstat (limited to 'storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test')
-rw-r--r--storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test65
1 files changed, 65 insertions, 0 deletions
diff --git a/storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test b/storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test
new file mode 100644
index 00000000000..bc802e4f2aa
--- /dev/null
+++ b/storage/tokudb/mysql-test/tokudb/t/cluster_2968-1.test
@@ -0,0 +1,65 @@
+# test that the query planner picks clustering keys for joins
+
+# create table s
+--disable_warnings
+drop table if exists s;
+--enable_warnings
+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
+--disable_warnings
+drop table if exists t;
+--enable_warnings
+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 key(b) clustering=yes;
+alter table t add key(b) clustering=yes;
+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;
+
+# cleanup
+drop table s,t;