diff options
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index dc8a5475162..cbc3d285d0a 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -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) |