mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-30693: Assertion `dbl_records <= s->records' failed in apply_selectivity_for_table on SELECT
The crash happened due to rows=2 vs rows=1 difference between how the estimate of number of rows in a derived table is computed in TABLE_LIST::fetch_number_of_rows() and JOIN::add_keyuses_for_splitting(). Made JOIN::add_keyuses_for_splitting() use the result of computations in TABLE_LIST::fetch_number_of_rows().
This commit is contained in:
@ -2322,5 +2322,14 @@ b
|
||||
9
|
||||
DROP TABLE t;
|
||||
#
|
||||
# MDEV-30693: Assertion `dbl_records <= s->records' failed in apply_selectivity_for_table on SELECT
|
||||
#
|
||||
set @tmp_oucs= @@optimizer_use_condition_selectivity;
|
||||
CREATE TABLE t1 (c INT KEY) ENGINE=InnoDB;
|
||||
SELECT * FROM (SELECT * FROM t1) a JOIN (SELECT * FROM (SELECT * FROM t1 GROUP BY c) d WHERE c>1) b ON a.c=b.c;
|
||||
c c
|
||||
DROP TABLE t1;
|
||||
SET optimizer_use_condition_selectivity=1;
|
||||
#
|
||||
# End of 11.0 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user