diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-10-23 23:37:57 +0500 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-10-23 23:37:57 +0500 |
commit | 1339fb17fef8d365bf0eba95ec73d00a21d8879a (patch) | |
tree | ff94c55f13de824f2f138ddcc0a51a69f16da7f9 /sql/opt_range.cc | |
parent | c2d3d6bbeffb37be5bfc0d2f003b29e9190362b2 (diff) | |
parent | b7ce2a01bc7cdf7984cbd12848f7f61c2f582a89 (diff) | |
download | mariadb-git-1339fb17fef8d365bf0eba95ec73d00a21d8879a.tar.gz |
Auto-merge.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 04dae4fd815..2f2506f02b1 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -5709,6 +5709,27 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field, !(conf_func->compare_collation()->state & MY_CS_BINSORT)) goto end; + if (key_part->image_type == Field::itMBR) + { + switch (type) { + case Item_func::SP_EQUALS_FUNC: + case Item_func::SP_DISJOINT_FUNC: + case Item_func::SP_INTERSECTS_FUNC: + case Item_func::SP_TOUCHES_FUNC: + case Item_func::SP_CROSSES_FUNC: + case Item_func::SP_WITHIN_FUNC: + case Item_func::SP_CONTAINS_FUNC: + case Item_func::SP_OVERLAPS_FUNC: + break; + default: + /* + We cannot involve spatial indexes for queries that + don't use MBREQUALS(), MBRDISJOINT(), etc. functions. + */ + goto end; + } + } + if (param->using_real_indexes) optimize_range= field->optimize_range(param->real_keynr[key_part->key], key_part->part); |