mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed bug mdev-5931.
After constant table row substitution the where condition may be converted to always true. The function calculate_cond_selectivity_for_table() should take into account this possibility.
This commit is contained in:
@ -3409,7 +3409,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item *cond)
|
||||
|
||||
table->cond_selectivity= 1.0;
|
||||
|
||||
if (table_records == 0)
|
||||
if (!cond || table_records == 0)
|
||||
DBUG_RETURN(FALSE);
|
||||
|
||||
if (table->pos_in_table_list->schema_table)
|
||||
|
Reference in New Issue
Block a user