Commit 462a72b8 authored by unknown's avatar unknown

Adding tests for the fixed ORDER BY 0 bug

parent 24978828
......@@ -146,3 +146,5 @@ SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
Unknown column 'a' in 'field list'
select 1 from (select 2) a order by 0;
Unknown column '0' in 'order clause'
......@@ -267,3 +267,5 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
2 UNION t1 ref b b 5 const 1 Using where
drop table t1,t2;
(select 1) union (select 2) order by 0;
Unknown column '0' in 'order clause'
......@@ -62,3 +62,5 @@ SELECT * FROM (SELECT 1 UNION SELECT a) b;
SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
--error 1054
SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
--error 1054
select 1 from (select 2) a order by 0;
......@@ -142,3 +142,5 @@ explain (select * from t1 where a=1) union (select * from t2 where a=1);
explain (select * from t1 where a=1 and b=10) union (select t1.a,t2.a from t1,t2 where t1.a=t2.a);
explain (select * from t1 where a=1) union (select * from t1 where b=1);
drop table t1,t2;
--error 1054
(select 1) union (select 2) order by 0;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment