1 -- source include/have_ndb.inc
2 -- source include/not_embedded.inc
5 drop table if exists t1, t2, t3, t4;
10 create table t1 (p int not null primary key, u int not null, o int not null,
11 unique (u), key(o)) engine=ndb;
13 create table t2 (p int not null primary key, u int not null, o int not null,
14 unique (u), key(o)) engine=ndb;
16 create table t3 (a int not null primary key, b int not null) engine=ndb;
17 create table t4 (c int not null primary key, d int not null) engine=ndb;
19 insert into t1 values (1,1,1),(2,2,2),(3,3,3);
20 insert into t2 values (1,1,1),(2,2,2),(3,3,3), (4,4,4), (5,5,5);
21 insert into t3 values (1,10), (2,10), (3,30), (4, 30);
22 insert into t4 values (1,10), (2,10), (3,30), (4, 30);
26 explain select * from t2 where p NOT IN (select p from t1);
27 select * from t2 where p NOT IN (select p from t1) order by p;
31 explain select * from t2 where p NOT IN (select u from t1);
32 select * from t2 where p NOT IN (select u from t1) order by p;
36 explain select * from t2 where p NOT IN (select o from t1);
37 select * from t2 where p NOT IN (select o from t1) order by p;
41 explain select * from t2 where p NOT IN (select p+0 from t1);
42 select * from t2 where p NOT IN (select p+0 from t1) order by p;
54 create table t1 (p int not null primary key, u int not null) engine=ndb;
55 insert into t1 values (1,1),(2,2),(3,3);
59 from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8
68 select * from t2 order by 1;
70 select * from t3 where a = any (select c from t4 where c = 1) order by a;
71 select * from t3 where a in (select c from t4 where c = 1) order by a;
72 select * from t3 where a <> some (select c from t4 where c = 1) order by a;
73 select * from t3 where a > all (select c from t4 where c = 1) order by a;
74 select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a;
75 select * from t3 where exists (select * from t4 where c = 1) order by a;
77 drop table if exists t1, t2, t3, t4;
79 --echo End of 5.1 tests