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

MDEV-31116 SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2

test_if_skip_sort_order() should check that the 'select' pointer
(=tab->select) is not NULL before dereferencing it when invoking
the test_quick_select method.

The check was erroneously removed by:
1c88ac60cf Simple cleanup of removing QQ comments from sql_select.cc
This commit is contained in:
Dave Gosselin
2023-10-31 14:17:24 -04:00
committed by Dave Gosselin
parent 9cc179cc7e
commit 1f7ab85644
3 changed files with 20 additions and 1 deletions

View File

@ -250,3 +250,12 @@ explain select * from t1 force index(r) order by a,b limit 20;
explain select * from t1 force index(r) order by a desc,b limit 20;
select * from t1 force index(r) order by a desc,b limit 20;
drop table t1;
--echo #
--echo # MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
--echo #
CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
DROP TABLE t1;
--echo # End of 11.0 tests