Loading mysql-test/r/subselect.result +6 −0 Original line number Diff line number Diff line Loading @@ -3177,3 +3177,9 @@ ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' DROP TABLE t1; create table t1 (i int, j bigint); insert into t1 values (1, 2), (2, 2), (3, 2); select * from (select min(i) from t1 where j=(select * from (select min(j) from t1) t2)) t3; min(i) 1 drop table t1; mysql-test/r/view.result +9 −0 Original line number Diff line number Diff line Loading @@ -2660,3 +2660,12 @@ SELECT * FROM v1; id t COUNT(*) DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (i INT, j BIGINT); INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); CREATE VIEW v1 AS SELECT MIN(j) AS j FROM t1; CREATE VIEW v2 AS SELECT MIN(i) FROM t1 WHERE j = ( SELECT * FROM v1 ); SELECT * FROM v2; MIN(i) 1 DROP VIEW v2, v1; DROP TABLE t1; mysql-test/t/subselect.test +9 −0 Original line number Diff line number Diff line Loading @@ -2100,3 +2100,12 @@ CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); DROP TABLE t1; # # Bug#19077: A nested materialized derived table is used before being populated. # create table t1 (i int, j bigint); insert into t1 values (1, 2), (2, 2), (3, 2); select * from (select min(i) from t1 where j=(select * from (select min(j) from t1) t2)) t3; drop table t1; mysql-test/t/view.test +11 −0 Original line number Diff line number Diff line Loading @@ -2528,3 +2528,14 @@ SELECT * FROM v1; DROP VIEW v1; DROP TABLE t1; # # Bug#19077: A nested materialized view is used before being populated. # CREATE TABLE t1 (i INT, j BIGINT); INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); CREATE VIEW v1 AS SELECT MIN(j) AS j FROM t1; CREATE VIEW v2 AS SELECT MIN(i) FROM t1 WHERE j = ( SELECT * FROM v1 ); SELECT * FROM v2; DROP VIEW v2, v1; DROP TABLE t1; sql/item.cc +1 −0 Original line number Diff line number Diff line Loading @@ -304,6 +304,7 @@ Item::Item(): marker= 0; maybe_null=null_value=with_sum_func=unsigned_flag=0; decimals= 0; max_length= 0; with_subselect= 0; /* Put item in free list so that we can free all items at end */ THD *thd= current_thd; Loading Loading
mysql-test/r/subselect.result +6 −0 Original line number Diff line number Diff line Loading @@ -3177,3 +3177,9 @@ ERROR 42S22: Unknown column 'no_such_column' in 'where clause' SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); ERROR 42S22: Unknown column 'no_such_column' in 'IN/ALL/ANY subquery' DROP TABLE t1; create table t1 (i int, j bigint); insert into t1 values (1, 2), (2, 2), (3, 2); select * from (select min(i) from t1 where j=(select * from (select min(j) from t1) t2)) t3; min(i) 1 drop table t1;
mysql-test/r/view.result +9 −0 Original line number Diff line number Diff line Loading @@ -2660,3 +2660,12 @@ SELECT * FROM v1; id t COUNT(*) DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (i INT, j BIGINT); INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); CREATE VIEW v1 AS SELECT MIN(j) AS j FROM t1; CREATE VIEW v2 AS SELECT MIN(i) FROM t1 WHERE j = ( SELECT * FROM v1 ); SELECT * FROM v2; MIN(i) 1 DROP VIEW v2, v1; DROP TABLE t1;
mysql-test/t/subselect.test +9 −0 Original line number Diff line number Diff line Loading @@ -2100,3 +2100,12 @@ CREATE VIEW v2 AS SELECT * FROM t1 WHERE no_such_column = (SELECT 1); SELECT * FROM t1 WHERE no_such_column = ANY (SELECT 1); DROP TABLE t1; # # Bug#19077: A nested materialized derived table is used before being populated. # create table t1 (i int, j bigint); insert into t1 values (1, 2), (2, 2), (3, 2); select * from (select min(i) from t1 where j=(select * from (select min(j) from t1) t2)) t3; drop table t1;
mysql-test/t/view.test +11 −0 Original line number Diff line number Diff line Loading @@ -2528,3 +2528,14 @@ SELECT * FROM v1; DROP VIEW v1; DROP TABLE t1; # # Bug#19077: A nested materialized view is used before being populated. # CREATE TABLE t1 (i INT, j BIGINT); INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2); CREATE VIEW v1 AS SELECT MIN(j) AS j FROM t1; CREATE VIEW v2 AS SELECT MIN(i) FROM t1 WHERE j = ( SELECT * FROM v1 ); SELECT * FROM v2; DROP VIEW v2, v1; DROP TABLE t1;
sql/item.cc +1 −0 Original line number Diff line number Diff line Loading @@ -304,6 +304,7 @@ Item::Item(): marker= 0; maybe_null=null_value=with_sum_func=unsigned_flag=0; decimals= 0; max_length= 0; with_subselect= 0; /* Put item in free list so that we can free all items at end */ THD *thd= current_thd; Loading