diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 76e1bd323ae..6b700d0c947 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -578,7 +578,7 @@ create table t1 select GeomFromWKB(POINT(1,3)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `GeomFromWKB(POINT(1,3))` geometry NOT NULL default '' + `GeomFromWKB(POINT(1,3))` geometry NOT NULL DEFAULT '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index ee4df8f1cfc..ef71dc9b8b5 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -27,8 +27,11 @@ Field *Item_geometry_func::tmp_table_field(TABLE *t_arg) { - return new Field_geom(max_length, maybe_null, name, t_arg->s, - (Field::geometry_type) get_geometry_type()); + Field *result; + if ((result= new Field_geom(max_length, maybe_null, name, t_arg->s, + (Field::geometry_type) get_geometry_type()))) + result->init(t_arg); + return result; } void Item_geometry_func::fix_length_and_dec()