mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 15:15:34 +02:00
Bug #16255: Subquery in WHERE (the cset by Georgi Kodinov)
Must not use Item_direct_ref in HAVING because it points to the new value (witch is not yet calculated for the first row). mysql-test/r/subselect.result: Bug #16255: Subquery in where - test case mysql-test/t/subselect.test: Bug #16255: Subquery in where - test case sql/item_subselect.cc: Bug #16255: Subquery in where Must not use Item_direct_ref in HAVING because it points to the new value (witch is not yet calculated for the first row).
This commit is contained in:
parent
9907e970ae
commit
c74c819533
3 changed files with 28 additions and 5 deletions
|
|
@ -2895,3 +2895,14 @@ select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
|
|||
s1
|
||||
2
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b));
|
||||
INSERT INTO t1 VALUES(26, 1), (48, 2);
|
||||
SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a,MAX(b) FROM t1 GROUP BY a);
|
||||
a b
|
||||
26 1
|
||||
48 2
|
||||
SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a + 0,MAX(b) FROM t1 GROUP BY a);
|
||||
a b
|
||||
26 1
|
||||
48 2
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
|
|
@ -1861,4 +1861,16 @@ select * from t1 where NOT(s1+1 = ANY (select s1 from t1));
|
|||
select * from t1 where (s1 = ALL (select s1/s1 from t1));
|
||||
select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #16255: Subquery in where
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b));
|
||||
|
||||
INSERT INTO t1 VALUES(26, 1), (48, 2);
|
||||
|
||||
SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a,MAX(b) FROM t1 GROUP BY a);
|
||||
SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a + 0,MAX(b) FROM t1 GROUP BY a);
|
||||
|
||||
DROP TABLE t1;
|
||||
# End of 4.1 tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue