diff options
author | tomas@poseidon.ndb.mysql.com <> | 2004-10-06 13:18:55 +0000 |
---|---|---|
committer | tomas@poseidon.ndb.mysql.com <> | 2004-10-06 13:18:55 +0000 |
commit | 884892a650992514c40dd652a4a8cf89e4f3a6f7 (patch) | |
tree | ebaf89381e7d046d746e9a8e8a1180e2b5c3de48 /mysql-test/t | |
parent | 96458f8f64641d5b974a17733af8c709b513bfe0 (diff) | |
download | mariadb-git-884892a650992514c40dd652a4a8cf89e4f3a6f7.tar.gz |
bug#5736, subqueries and not in
and testcases
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/ndb_subquery.test | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/t/ndb_subquery.test new file mode 100644 index 00000000000..e80d9b16b46 --- /dev/null +++ b/mysql-test/t/ndb_subquery.test @@ -0,0 +1,38 @@ +-- source include/have_ndb.inc + +--disable_warnings +drop table if exists t1; +drop table if exists t2; +--enable_warnings + +########## +# bug#5367 +create table t1 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; + +create table t2 (p int not null primary key, u int not null, o int not null, +unique (u), key(o)) engine=ndb; + +insert into t1 values (1,1,1),(2,2,2),(3,3,3); +insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5); + +# Use pk +explain select * from t2 where p NOT IN (select p from t1); +select * from t2 where p NOT IN (select p from t1); + +# Use unique index +explain select * from t2 where p NOT IN (select u from t1); +select * from t2 where p NOT IN (select u from t1); + +# Use ordered index +explain select * from t2 where p NOT IN (select o from t1); +select * from t2 where p NOT IN (select o from t1); + +# Use scan +explain select * from t2 where p NOT IN (select p+0 from t1); +select * from t2 where p NOT IN (select p+0 from t1); + +drop table t1; +drop table t2; +# bug#5367 +########## |