diff options
-rw-r--r-- | sql/opt_range.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 3bcaa72e32f..a3943cbe3ff 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3350,7 +3350,9 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param, if (bitmap_is_set(used_fields, (*field_ptr)->field_index)) { Field *field= *field_ptr; - if (field->type() == MYSQL_TYPE_GEOMETRY) + Column_statistics* col_stats= field->read_stats; + if (field->type() == MYSQL_TYPE_GEOMETRY || + !col_stats || col_stats->no_stat_values_provided()) continue; uint16 store_length; |