summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-03-28 14:35:23 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-03-28 14:35:23 +0300
commitc8f1cf4cf95279ad5726230603630cff2e6f7212 (patch)
tree402e379dbc4710d36705abe59672fbe2baad57da /sql/sql_select.cc
parent04dc7c88309c270bb8607a2a195bb93aeccb4988 (diff)
downloadmariadb-git-c8f1cf4cf95279ad5726230603630cff2e6f7212.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). mysql-test/r/gis.result: Bug #27300: test case mysql-test/t/gis.test: Bug #27300: test case sql/item.cc: Bug #27300: Create a GEOMETRY field (Field_geom) instead of a generic BLOB (Field_blob) in temp tables for the results of GIS functions (Item_geometry_func). sql/sql_select.cc: Bug #27300: Create a GEOMETRY field (Field_geom) instead of a generic BLOB (Field_blob) in temp tables for the results of GIS functions (Item_geometry_func).
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index bb57764700d..d983146da93 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -8793,12 +8793,12 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
enum enum_field_types type;
/*
- DATE/TIME fields have STRING_RESULT result type. To preserve
- type they needed to be handled separately.
+ DATE/TIME and GEOMETRY fields have STRING_RESULT result type.
+ To preserve type they needed to be handled separately.
*/
if ((type= item->field_type()) == MYSQL_TYPE_DATETIME ||
type == MYSQL_TYPE_TIME || type == MYSQL_TYPE_DATE ||
- type == MYSQL_TYPE_TIMESTAMP)
+ type == MYSQL_TYPE_TIMESTAMP || type == MYSQL_TYPE_GEOMETRY)
new_field= item->tmp_table_field_from_field_type(table);
/*
Make sure that the blob fits into a Field_varstring which has