diff options
Diffstat (limited to 'mysql-test/r/ndb_subquery.result')
-rw-r--r-- | mysql-test/r/ndb_subquery.result | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/r/ndb_subquery.result index 312711ab4b7..f2c9972f774 100644 --- a/mysql-test/r/ndb_subquery.result +++ b/mysql-test/r/ndb_subquery.result @@ -1,11 +1,14 @@ -drop table if exists t1; -drop table if exists t2; +drop table if exists t1, t2, t3, t4; 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; +create table t3 (a int not null primary key, b int not null) engine=ndb; +create table t4 (c int not null primary key, d int not null) 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); +insert into t3 values (1,10), (2,10), (3,30), (4, 30); +insert into t4 values (1,10), (2,10), (3,30), (4, 30); explain select * from t2 where p NOT IN (select p from t1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL # Using where @@ -57,5 +60,33 @@ p u 1 1 2 2 3 3 -drop table t1; -drop table t2; +select * from t3 where a = any (select c from t4 where c = 1) order by a; +a b +1 10 +select * from t3 where a in (select c from t4 where c = 1) order by a; +a b +1 10 +select * from t3 where a <> some (select c from t4 where c = 1) order by a; +a b +2 10 +3 30 +4 30 +select * from t3 where a > all (select c from t4 where c = 1) order by a; +a b +2 10 +3 30 +4 30 +select * from t3 where row(1,10) = (select c,d from t4 where c = 1) order by a; +a b +1 10 +2 10 +3 30 +4 30 +select * from t3 where exists (select * from t4 where c = 1) order by a; +a b +1 10 +2 10 +3 30 +4 30 +drop table if exists t1, t2, t3, t4; +End of 5.1 tests |