diff options
author | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-10-04 12:01:28 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/hfmain.(none)> | 2007-10-04 12:01:28 +0500 |
commit | 813e6bcbbda3d7e4b6ad803e2993f9718ebe7daa (patch) | |
tree | c81c531f558a4c78b2b3c57231794a9e40937837 /sql/item_geofunc.h | |
parent | 0ad23eb8a5f377e94d4b4ae83f39555dbe75c3b0 (diff) | |
download | mariadb-git-813e6bcbbda3d7e4b6ad803e2993f9718ebe7daa.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.
sql/item.h:
Bug #31155 gis types in union'd select cause crash.
virtual Item::geometry_type() added instead of
various geometry_type() fucntions.
sql/item.cc:
Bug #31155 gis types in union'd select cause crash.
Unified virtual ::get_geometry_type() function used
sql/item_geofunc.cc:
Bug #31155 gis types in union'd select cause crash.
virtual Item::geometry_type() implemented for geo-Items.
Mostly previous ::get_geometry_type() implementation changed
sql/item_geofunc.h:
Bug #31155 gis types in union'd select cause crash.
get_geometry_type() declarations unified
Diffstat (limited to 'sql/item_geofunc.h')
-rw-r--r-- | sql/item_geofunc.h | 7 |
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 |