mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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:
@@ -741,7 +741,12 @@ void JOIN::add_keyuses_for_splitting()
|
||||
if (ext_keyuses_for_splitting->push(keyuse_ext_end))
|
||||
goto err;
|
||||
|
||||
spl_opt_info->unsplit_card= join_record_count;
|
||||
/*
|
||||
Use the number of rows that was computed by
|
||||
TABLE_LIST::fetch_number_of_rows():
|
||||
*/
|
||||
spl_opt_info->unsplit_card=
|
||||
rows2double(select_lex->master_unit()->derived->table->stat_records());
|
||||
|
||||
rec_len= table->s->rec_buff_length;
|
||||
|
||||
|
Reference in New Issue
Block a user