diff options
author | bell@sanja.is.com.ua <> | 2004-06-22 13:41:57 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-06-22 13:41:57 +0300 |
commit | c6cd51798bb68b839dcfefa48d409cd117c4c743 (patch) | |
tree | ab028ded5be83f99a5c38502e208fdaf377e9d90 | |
parent | cb0f607c5e30933244f6fbf2ee81c5f97fcaafd7 (diff) | |
download | mariadb-git-c6cd51798bb68b839dcfefa48d409cd117c4c743.tar.gz |
post-review changes (Bug#4090)
-rw-r--r-- | mysql-test/r/subselect.result | 25 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 10 |
2 files changed, 29 insertions, 6 deletions
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index b96cc03dfab..9187504a0c8 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1841,11 +1841,6 @@ id name id pet 2 Rebecca 2 Spot 3 NULL 3 Felix drop table t1,t2; -DROP TABLE IF EXISTS t1, t2, t3; -Warnings: -Note 1051 Unknown table 't1' -Note 1051 Unknown table 't2' -Note 1051 Unknown table 't3' CREATE TABLE t1 ( a int, b int ); CREATE TABLE t2 ( c int, d int ); INSERT INTO t1 VALUES (1,2), (2,3), (3,4); @@ -1866,4 +1861,24 @@ abc b 1 2 2 3 3 4 +prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +deallocate prepare stmt1; +select * from t2; +c d +1 2 +2 3 +3 4 +1 2 +2 3 +3 4 +drop table t3; +prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +select * from t3; +abc b +1 2 +2 3 +3 4 +deallocate prepare stmt1; DROP TABLE t1, t2, t3; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index b51f89086b4..8cbaed05e3f 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1182,7 +1182,6 @@ drop table t1,t2; # # outer fields resolving in INSERT/REPLACE and CRETE with SELECT # -DROP TABLE IF EXISTS t1, t2, t3; CREATE TABLE t1 ( a int, b int ); CREATE TABLE t2 ( c int, d int ); INSERT INTO t1 VALUES (1,2), (2,3), (3,4); @@ -1191,4 +1190,13 @@ INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE select * from t2; CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); select * from t3; +prepare stmt1 from "INSERT INTO t2 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +deallocate prepare stmt1; +select * from t2; +drop table t3; +prepare stmt1 from "CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);"; +execute stmt1; +select * from t3; +deallocate prepare stmt1; DROP TABLE t1, t2, t3; |