diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result index 5d6e5787d8c..e101c6142db 100644 --- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result +++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result @@ -740,3 +740,19 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p); ALTER TABLE t1 FORCE, LOCK=NONE; ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED DROP TABLE t1; +create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb; +set timestamp=10; +insert into t1 values(default); +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +drop table t1; +SET timestamp=default; +create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb; +set timestamp=10; +alter table t1 add column i int; +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +drop table t1; +SET timestamp=default; +CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB; +ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0'; +ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test index f02c2f9cd1a..c4cd100c7e3 100644 --- a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test +++ b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test @@ -739,3 +739,23 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p); --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE t1 FORCE, LOCK=NONE; DROP TABLE t1; + +create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb; +set timestamp=10; +--error ER_CANT_CREATE_GEOMETRY_OBJECT +insert into t1 values(default); +drop table t1; +SET timestamp=default; + +create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb; +set timestamp=10; +--error ER_CANT_CREATE_GEOMETRY_OBJECT +alter table t1 add column i int; +drop table t1; +SET timestamp=default; + +CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB; +--error ER_CANT_CREATE_GEOMETRY_OBJECT +ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0'; +DROP TABLE t1; +