summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2018-08-29 04:39:42 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2018-08-29 12:48:23 +0530
commitb3c320bb0b93e516cda4db277cfa3efeef48c988 (patch)
treefa58cf4b3be39eca2c259c8b4d7fb1ef5d834980 /sql/opt_range.cc
parenta9c09c95bdd33ee0cbd3fb3254753ab2fc56f2a5 (diff)
downloadmariadb-git-b3c320bb0b93e516cda4db277cfa3efeef48c988.tar.gz
MDEV-16995: ER_CANT_CREATE_GEOMETRY_OBJECT encountered for a query with
optimizer_use_condition_selectivity>=3 Selectivity analysis should be disabled for Geometrical columns for the case like geometric_field= string_constant.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index ceabac2b744..0fd2cd267fc 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -3328,7 +3328,8 @@ bool create_key_parts_for_pseudo_indexes(RANGE_OPT_PARAM *param,
{
Column_statistics* col_stats= (*field_ptr)->read_stats;
if (bitmap_is_set(used_fields, (*field_ptr)->field_index)
- && col_stats && !col_stats->no_stat_values_provided())
+ && col_stats && !col_stats->no_stat_values_provided()
+ && !((*field_ptr)->type() == MYSQL_TYPE_GEOMETRY))
parts++;
}
@@ -3349,6 +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)
+ continue;
+
uint16 store_length;
uint16 max_key_part_length= (uint16) table->file->max_key_part_length();
key_part->key= keys;