diff options
-rw-r--r-- | mysql-test/r/gis.result | 6 | ||||
-rw-r--r-- | mysql-test/t/gis.test | 8 | ||||
-rw-r--r-- | sql/field.h | 4 | ||||
-rw-r--r-- | sql/field_conv.cc | 4 |
4 files changed, 18 insertions, 4 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 89831e8ac88..3a7b2b98751 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -458,3 +458,9 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select high_priority issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` +create table t1 (a geometry not null); +insert into t1 values (GeomFromText('Point(1 2)')); +insert into t1 values ('Garbage'); +ERROR HY000: Unknown error +alter table t1 add spatial index(a); +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 35f2cff8f9a..541cff731b8 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -160,3 +160,11 @@ SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); #select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)),issimple(PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),issimple(GeometryFromText('POINT(1 4)')), issimple(AsWKB(GeometryFromText('POINT(1 4)'))); explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)); + +create table t1 (a geometry not null); +insert into t1 values (GeomFromText('Point(1 2)')); +-- error 1105 +insert into t1 values ('Garbage'); +alter table t1 add spatial index(a); + +drop table t1; diff --git a/sql/field.h b/sql/field.h index f815324c698..22d406b339a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1184,8 +1184,8 @@ Field *make_field(char *ptr, uint32 field_length, struct st_table *table); uint pack_length_to_packflag(uint type); uint32 calc_pack_length(enum_field_types type,uint32 length); -bool set_field_to_null(Field *field); -bool set_field_to_null_with_conversions(Field *field, bool no_conversions); +int set_field_to_null(Field *field); +int set_field_to_null_with_conversions(Field *field, bool no_conversions); bool test_if_int(const char *str, int length, const char *int_end, CHARSET_INFO *cs); diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 47402c32aa4..3272c2faf48 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -109,7 +109,7 @@ static void do_outer_field_to_null_str(Copy_field *copy) } -bool +int set_field_to_null(Field *field) { if (field->real_maybe_null()) @@ -149,7 +149,7 @@ set_field_to_null(Field *field) If no_conversion was not set, an error message is printed */ -bool +int set_field_to_null_with_conversions(Field *field, bool no_conversions) { if (field->real_maybe_null()) |