1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-18668 Server crash or ASAN use-after-poison in Item_equal_iterator /

st_select_lex::pushdown_from_having_into_where upon query
           with impossible WHERE condition

Do not push from HAVING into impossible WHERE
This commit is contained in:
Igor Babaev
2019-02-24 02:02:07 -08:00
parent 31deef0953
commit 25870f48cf
3 changed files with 30 additions and 1 deletions

View File

@ -1906,3 +1906,15 @@ EXPLAIN
DROP TABLE t1,t2;
DROP VIEW v1;
DROP FUNCTION f1;
#
# MDEV-18668: pushdown from HAVING into impossible WHERE
#
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1),(2,2);
SELECT a FROM t1 WHERE b = 1 AND b = 2 GROUP BY a HAVING a <= 3;
a
EXPLAIN
SELECT a FROM t1 WHERE b = 1 AND b = 2 GROUP BY a HAVING a <= 3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
DROP TABLE t1;