diff options
author | gkodinov/kgeorge@magare.gmz <> | 2007-03-28 14:35:23 +0300 |
---|---|---|
committer | gkodinov/kgeorge@magare.gmz <> | 2007-03-28 14:35:23 +0300 |
commit | c3eb3f7093b5be942d036995db543120080b206f (patch) | |
tree | 402e379dbc4710d36705abe59672fbe2baad57da /sql/item.cc | |
parent | 9c55cd3e032dc85cf44042ed6d035936ca4e14ae (diff) | |
download | mariadb-git-c3eb3f7093b5be942d036995db543120080b206f.tar.gz |
Bug #27300:
Geometry fields have a result type string and a
special subclass to cater for the differences
between them and the base class (just like
DATE/TIME).
When creating temporary tables for results of
functions that return results of type GEOMETRY
we must construct fields of the derived class
instead of the base class.
Fixed by creating a GEOMETRY field (Field_geom)
instead of a generic BLOB (Field_blob) in temp
tables for the results of GIS functions that
have GEOMETRY return type (Item_geometry_func).
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 808e7925729..8568a44c547 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4275,7 +4275,6 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table) case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_GEOMETRY: if (this->type() == Item::TYPE_HOLDER) return new Field_blob(max_length, maybe_null, name, table, collation.collation, 1); @@ -4283,6 +4282,10 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table) return new Field_blob(max_length, maybe_null, name, table, collation.collation); break; // Blob handled outside of case + case MYSQL_TYPE_GEOMETRY: + return new Field_geom(max_length, maybe_null, name, table, + (Field::geometry_type) + ((Item_geometry_func *)this)->get_geometry_type()); } } |