mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
some bug fixes and tests for those.
I am pushing now, because : * I have a fix for crashing bug * Sanja will destroy my changes in sub-select test ... ;) mysql-test/r/derived.result: tests for recent bugs mysql-test/r/subselect.result: tests for recent bugs mysql-test/t/derived.test: tests for recent bugs mysql-test/t/subselect.test: tests for recent bugs sql/sql_derived.cc: Luckily, we have `make test` so that my last changes could be re-checked
This commit is contained in:
@ -30,6 +30,29 @@ SELECT 1 FROM (SELECT 1) a WHERE a=2;
|
||||
Unknown column 'a' in 'where clause'
|
||||
SELECT (SELECT 1) as a FROM (SELECT 1 FROM t1 HAVING a=1) as a;
|
||||
Unknown column 'a' in 'having clause'
|
||||
select * from t1 as x1, (select * from t1) as x2;
|
||||
a b a b
|
||||
1 a 1 a
|
||||
2 b 1 a
|
||||
3 c 1 a
|
||||
3 c 1 a
|
||||
1 a 2 b
|
||||
2 b 2 b
|
||||
3 c 2 b
|
||||
3 c 2 b
|
||||
1 a 3 c
|
||||
2 b 3 c
|
||||
3 c 3 c
|
||||
3 c 3 c
|
||||
1 a 3 c
|
||||
2 b 3 c
|
||||
3 c 3 c
|
||||
3 c 3 c
|
||||
explain select * from t1 as x1, (select * from t1) as x2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY x1 ALL NULL NULL NULL NULL 4
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
|
||||
2 DERIVED x1 ALL NULL NULL NULL NULL 4
|
||||
drop table if exists t1.t2,t3;
|
||||
select * from (select 1) as a;
|
||||
1
|
||||
@ -66,7 +89,8 @@ a t
|
||||
20 20
|
||||
explain select count(*) from t1 as tt1, (select * from t1) as tt2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE Select tables optimized away
|
||||
1 PRIMARY Select tables optimized away
|
||||
2 DERIVED tt1 index NULL a 4 NULL 10000 Using index
|
||||
drop table if exists t1;
|
||||
SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
|
||||
(SELECT * FROM (SELECT 1 as a) as a )
|
||||
|
Reference in New Issue
Block a user