1
0
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:
Igor Babaev
2014-03-22 12:44:39 -07:00
parent b352969118
commit 887a210ffc
4 changed files with 68 additions and 1 deletions

View File

@ -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)