summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-06-26 22:49:49 +0400
committerAlexander Barkov <bar@mariadb.org>2015-06-26 22:49:49 +0400
commit55d8ee5f707bab41068d79144e6cf4a01c6eea76 (patch)
tree9370cb66649e8be2c835c56a610471065d64a95c /sql/item_geofunc.h
parentcb5f32ebe3b0c693c99d0e7c1b6bc5d6b0677f48 (diff)
downloadmariadb-git-55d8ee5f707bab41068d79144e6cf4a01c6eea76.tar.gz
MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
Moving Item_func_spatial_rel from Item_bool_func to Item_bool_func2. to make OP(const,field) use indexes. - MBR functions supported OP(const,field) optimization in 10.0, but were inintentionally broken in an earlier 10.1 change that introduced a common parent for Item_func_spatial_mbr_rel and Item_func_spatial_precise_rel. - Precise functions never supported optimization for OP(const,field). Now both MBR and precise functions support OP(const,field) optimization.
Diffstat (limited to 'sql/item_geofunc.h')
-rw-r--r--sql/item_geofunc.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 72dddee1fba..4ae3be73da1 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -272,19 +272,18 @@ public:
Spatial relations
*/
-class Item_func_spatial_rel: public Item_bool_func
+class Item_func_spatial_rel: public Item_bool_func2
{
protected:
enum Functype spatial_rel;
String tmp_value1, tmp_value2;
public:
Item_func_spatial_rel(Item *a, Item *b, enum Functype sp_rel)
- :Item_bool_func(a, b), spatial_rel(sp_rel)
+ :Item_bool_func2(a, b), spatial_rel(sp_rel)
{ }
enum Functype functype() const { return spatial_rel; }
enum Functype rev_functype() const { return spatial_rel; }
bool is_null() { (void) val_int(); return null_value; }
- optimize_type select_optimize() const { return OPTIMIZE_OP; }
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
SARGABLE_PARAM **sargables)