Commit e2a57933 authored by unknown's avatar unknown

post-review changes (Bug#4090)


mysql-test/r/subselect.result:
  prepare statement test added
mysql-test/t/subselect.test:
  prepare statement test added
parent 7c021c3a
...@@ -1841,11 +1841,6 @@ id name id pet ...@@ -1841,11 +1841,6 @@ id name id pet
2 Rebecca 2 Spot 2 Rebecca 2 Spot
3 NULL 3 Felix 3 NULL 3 Felix
drop table t1,t2; 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 t1 ( a int, b int );
CREATE TABLE t2 ( c int, d int ); CREATE TABLE t2 ( c int, d int );
INSERT INTO t1 VALUES (1,2), (2,3), (3,4); INSERT INTO t1 VALUES (1,2), (2,3), (3,4);
...@@ -1866,4 +1861,24 @@ abc b ...@@ -1866,4 +1861,24 @@ abc b
1 2 1 2
2 3 2 3
3 4 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; DROP TABLE t1, t2, t3;
...@@ -1182,7 +1182,6 @@ drop table t1,t2; ...@@ -1182,7 +1182,6 @@ drop table t1,t2;
# #
# outer fields resolving in INSERT/REPLACE and CRETE with SELECT # 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 t1 ( a int, b int );
CREATE TABLE t2 ( c int, d int ); CREATE TABLE t2 ( c int, d int );
INSERT INTO t1 VALUES (1,2), (2,3), (3,4); 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 ...@@ -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; select * from t2;
CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc); CREATE TABLE t3 SELECT a AS abc, b FROM t1 WHERE b = (SELECT MIN(b) FROM t1 WHERE a=abc);
select * from t3; 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; DROP TABLE t1, t2, t3;
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