summaryrefslogtreecommitdiff
path: root/sql/item_geofunc.h
diff options
context:
space:
mode:
authorholyfoot/hf@mysql.com/hfmain.(none) <>2007-10-04 12:01:28 +0500
committerholyfoot/hf@mysql.com/hfmain.(none) <>2007-10-04 12:01:28 +0500
commit16db036d82eba4bbfced502fe271ce863a354c60 (patch)
treec81c531f558a4c78b2b3c57231794a9e40937837 /sql/item_geofunc.h
parent93d44a183d1cf6e45a6076600ba475977d506109 (diff)
downloadmariadb-git-16db036d82eba4bbfced502fe271ce863a354c60.tar.gz
Bug #31155 gis types in union'd select cause crash.
We use get_geometry_type() call to decide the exact type of a geometry field to be created (POINT, POLYGON etc) Though this function was only implemented for few items. In the bug's case we need to call this function for the Item_sum instance, where it was not implemented, what is the reason of the crash. Fixed by implementing virtual Item::get_geometry_type(), so it can be called for any Item.
Diffstat (limited to 'sql/item_geofunc.h')
-rw-r--r--sql/item_geofunc.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 9c7970f9e53..e99510f762f 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -33,7 +33,6 @@ public:
void fix_length_and_dec();
enum_field_types field_type() const { return MYSQL_TYPE_GEOMETRY; }
Field *tmp_table_field(TABLE *t_arg);
- virtual int get_geometry_type() const;
bool is_null() { (void) val_int(); return null_value; }
};
@@ -92,7 +91,7 @@ public:
Item_func_centroid(Item *a): Item_geometry_func(a) {}
const char *func_name() const { return "centroid"; }
String *val_str(String *);
- int get_geometry_type() const;
+ Field::geometry_type get_geometry_type() const;
};
class Item_func_envelope: public Item_geometry_func
@@ -101,7 +100,7 @@ public:
Item_func_envelope(Item *a): Item_geometry_func(a) {}
const char *func_name() const { return "envelope"; }
String *val_str(String *);
- int get_geometry_type() const;
+ Field::geometry_type get_geometry_type() const;
};
class Item_func_point: public Item_geometry_func
@@ -111,7 +110,7 @@ public:
Item_func_point(Item *a, Item *b, Item *srid): Item_geometry_func(a, b, srid) {}
const char *func_name() const { return "point"; }
String *val_str(String *);
- int get_geometry_type() const;
+ Field::geometry_type get_geometry_type() const;
};
class Item_func_spatial_decomp: public Item_geometry_func