1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-28097 use-after-free when WHERE has subquery with an outer reference in HAVING

when resolving WHERE and ON clauses, do not look in
SELECT list/aliases.
This commit is contained in:
Sergei Golubchik
2022-04-29 14:50:47 +02:00
parent 8c34eab968
commit 0beed9b5e9
5 changed files with 26 additions and 6 deletions

View File

@ -249,7 +249,8 @@ where t1.col2 in
group by t2.col1, t2.col2 having t1.col1 <= 10);
# the having column is resolved in the SELECT clause of the outer query -
# error in ANSI, works with MySQL extension
# error in ANSI
--error ER_BAD_FIELD_ERROR
select t1.col1 as tmp_col from t1
where t1.col2 in
(select t2.col2 from t2