From a83ed34f83bbb325c07fd6bfe41d64f777564af8 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Tue, 17 Dec 2002 20:15:15 +0200 Subject: A fix for a bug in fix_fields in case like this: select .. UNION select some_column; This is exhibited in sub-selects and derived tables. --- mysql-test/r/derived.result | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/r/derived.result') diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 03e00b206b2..c4475cf7357 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -123,3 +123,5 @@ SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b; select * from (select 1 as a) b left join (select 2 as a) c using(a); a a 1 NULL +SELECT * FROM (SELECT 1 UNION SELECT a) b; +Unknown column 'a' in 'field list' -- cgit v1.2.1 From 675098852c08f94baea87c8d9d5aed51670dda6b Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Tue, 17 Dec 2002 22:36:23 +0200 Subject: Fix for fix_fields in derived tables with UNION's .... --- mysql-test/r/derived.result | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/r/derived.result') diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index c4475cf7357..f7cd45090c4 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -125,3 +125,7 @@ a a 1 NULL SELECT * FROM (SELECT 1 UNION SELECT a) b; Unknown column 'a' in 'field list' +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' -- cgit v1.2.1 From 9e2d9aa27499a1c85baf6b66e20a24fa3f679190 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Tue, 17 Dec 2002 23:18:19 +0200 Subject: fixed derived table visibility scope for derived tables with union --- mysql-test/r/derived.result | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/r/derived.result') diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 03e00b206b2..06d2e663221 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -1,3 +1,7 @@ +SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; +Unknown column 'a' in 'field list' +SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; +Unknown column 'a' in 'field list' drop table if exists t1,t2,t3; CREATE TABLE t1 (a int not null, b char (10) not null); insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); -- cgit v1.2.1 From d85a01db2cd557cecc06cebe45502f54de233dac Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Thu, 26 Dec 2002 17:48:19 +0200 Subject: added FROM DUAL for derived tables --- mysql-test/r/derived.result | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/r/derived.result') diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 06d2e663221..6a3aa328175 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -1,3 +1,6 @@ +select * from (select 2 from DUAL) b; +2 +2 SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; Unknown column 'a' in 'field list' SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; -- cgit v1.2.1 From 1f6ecc0cd3d9acf4751ebbbf8db8b6ee468d3abf Mon Sep 17 00:00:00 2001 From: "monty@mashka.mysql.fi" <> Date: Mon, 6 Jan 2003 01:48:59 +0200 Subject: Changed mysql-test to print warnings for not existing table to DROP TABLE Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names. changed store_warning() -> push_warning_print() --- mysql-test/r/derived.result | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test/r/derived.result') diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index e2d2b1cb652..4f16e239e15 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -1,3 +1,4 @@ +drop table if exists t1,t2,t3; select * from (select 2 from DUAL) b; 2 2 @@ -5,7 +6,6 @@ SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; Unknown column 'a' in 'field list' SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; Unknown column 'a' in 'field list' -drop table if exists t1,t2,t3; CREATE TABLE t1 (a int not null, b char (10) not null); insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); CREATE TABLE t2 (a int not null, b char (10) not null); @@ -60,7 +60,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY x1 ALL NULL NULL NULL NULL 4 1 PRIMARY ALL NULL NULL NULL NULL 4 2 DERIVED x1 ALL NULL NULL NULL NULL 4 -drop table if exists t1.t2,t3; +drop table if exists t2,t3; select * from (select 1) as a; 1 1 @@ -123,7 +123,7 @@ 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 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 2 DERIVED tt1 index NULL a 4 NULL 10000 Using index -drop table if exists t1; +drop table t1; SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b; (SELECT * FROM (SELECT 1 as a) as a ) 1 -- cgit v1.2.1