diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2019-05-16 13:49:47 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2019-05-16 14:15:59 +0530 |
commit | 70a5fb49a74e2dfd57fa79ebbc0fc780ce898841 (patch) | |
tree | 258c487b093d1f2f083957de02df4cafce8f1d11 /sql/opt_range.cc | |
parent | 6ab9d1627a16b79429036f0ef10e05639bbcf46b (diff) | |
download | mariadb-git-70a5fb49a74e2dfd57fa79ebbc0fc780ce898841.tar.gz |
Fixed the case when statistics were not getting read because
we had the statistics tables in the FROM list of the select.
The statistics for tables are not read in such cases, so we need
to check this case separately.
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 71e8055394c..e8421ad052a 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3050,7 +3050,7 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) if (thd->variables.optimizer_use_condition_selectivity > 2 && !bitmap_is_clear_all(used_fields) && - thd->variables.use_stat_tables > 0) + thd->variables.use_stat_tables > 0 && table->stats_is_read) { PARAM param; MEM_ROOT alloc; |