From c8f1cf4cf95279ad5726230603630cff2e6f7212 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 28 Mar 2007 14:35:23 +0300 Subject: 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). --- sql/sql_select.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/sql_select.cc') 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 -- cgit v1.2.1