summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/derived.result5
-rw-r--r--mysql-test/r/union.result2
-rw-r--r--mysql-test/t/derived.test1
-rw-r--r--mysql-test/t/union.test2
4 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index e335e316170..bfd4c544131 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -105,6 +105,11 @@ a b
1 a
2 b
3 c
+explain select * from (select * from t1,t2 where t1.a=t2.a) t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> system NULL NULL NULL NULL 1
+2 DERIVED t2 system NULL NULL NULL NULL 1
+2 DERIVED t1 ALL NULL NULL NULL NULL 4 Using where
drop table t1, t2;
create table t1(a int not null, t char(8), index(a));
SELECT * FROM (SELECT * FROM t1) as b ORDER BY a ASC LIMIT 0,20;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 0edf5df7ae1..7b29a8fbcde 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -273,3 +273,5 @@ SELECT @a:=1 UNION SELECT @a:=@a+1;
@a:=1
1
2
+(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
+Unknown column 'a' in 'field list'
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 8b8d9e4d1a2..2ce90c93bd9 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -41,6 +41,7 @@ CREATE TABLE t2 (a int not null);
insert into t2 values(1);
select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a;
select * from (select * from t1 where t1.a=(select t2.a from t2 where t2.a=t1.a) union select t1.a, t1.b from t1) a;
+explain select * from (select * from t1,t2 where t1.a=t2.a) t1;
drop table t1, t2;
create table t1(a int not null, t char(8), index(a));
disable_query_log;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index d2f35b59f54..70e770cd2d3 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -146,3 +146,5 @@ drop table t1,t2;
(select 1) union (select 2) order by 0;
SELECT @a:=1 UNION SELECT @a:=@a+1;
+--error 1054
+(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);