diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2020-05-11 19:56:14 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2020-05-11 20:01:11 +0530 |
commit | 3f7e71439f6fb781a6eff0a70dfbf65ba9ef3540 (patch) | |
tree | fb151e6dc4a0404178434229129ad3909bf33e20 /mysql-test/t | |
parent | 1887b5ae87ac0d1519f95a1e2f59efe09aded98f (diff) | |
download | mariadb-git-10.1-mdev22498.tar.gz |
MDEV-22498: SIGSEGV in Bitmap<64u>::merge on SELECT10.1-mdev22498
For the case when the optimizer does the IN-EXISTS transformation,
the equality condition is injected in the WHERE OR HAVING clause of
the subquery. If the select list of the subquery has a reference to
the parent select make sure to use the reference and not the original
item.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/subselect4.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index d5a40419185..f0b1d16be7b 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -2075,3 +2075,27 @@ insert into t1 values(2,1),(1,2); select (select c1 from t1 group by c1,c2 order by c1 limit 1) as x; (select c1 from t1 group by c1,c2 order by c1 limit 1); drop table t1; + +--echo # +--echo # MDEV-22498: SIGSEGV in Bitmap<64u>::merge on SELECT +--echo # + +set @save_sql_select_limit= @@sql_select_limit; +SET sql_select_limit=0; + +CREATE TABLE t1(b INT, c INT); +CREATE TABLE t2(a INT, b INT); +INSERT INTO t1 VALUES (1,1),(2,2),(3,3); +INSERT INTO t2 VALUES (1,1),(2,2),(3,3); + +let $query= +SELECT sum(a), t2.a, t2.b FROM t2 HAVING t2.a IN (SELECT t2.b FROM t1); + +eval EXPLAIN EXTENDED $query; +eval $query; + +SET @@sql_select_limit= @save_sql_select_limit; + +eval EXPLAIN EXTENDED $query; +eval $query; +DROP TABLE t1,t2; |