mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
BUG#1002630: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SELECT
- In JOIN::exec(), make the having->update_used_tables() call before we've made the JOIN::cleanup(full=true) call. The latter frees SJ-Materialization structures, which correlated subquery predicate items attempt to walk afterwards.
This commit is contained in:
@ -2445,5 +2445,22 @@ GROUP BY field1;
|
||||
|
||||
DROP TABLE t1,t3,t2;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#1002630: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SELECT
|
||||
--echo #
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT INTO t1 VALUES (1),(7);
|
||||
|
||||
CREATE TABLE t2 (b INT);
|
||||
INSERT INTO t2 VALUES (4),(6);
|
||||
|
||||
SELECT ( SELECT SUM(a) FROM t1 ) AS t1sum, b
|
||||
FROM t2
|
||||
WHERE (1,1) IN ( SELECT MAX(a), MIN(a) FROM t1 )
|
||||
GROUP BY b
|
||||
HAVING t1sum <> 1;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
# The following command must be the last one the file
|
||||
set optimizer_switch=@subselect_sj_tmp;
|
||||
|
Reference in New Issue
Block a user