summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb_gis
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-18 14:11:55 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-18 14:11:55 +0400
commit30e7d6709f7fb0f70a07c80a1a06614ca23da5f4 (patch)
tree9ba11fd32d82ac5c1364a537532ac896c4dd2058 /mysql-test/suite/innodb_gis
parent75aabd03d57f85d63d57b25a239b4f930a3ae3c0 (diff)
parent3bc094d32a360b7d51600cf11bc4ce24117ecb78 (diff)
downloadmariadb-git-30e7d6709f7fb0f70a07c80a1a06614ca23da5f4.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'mysql-test/suite/innodb_gis')
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result16
-rw-r--r--mysql-test/suite/innodb_gis/t/alter_spatial_index.test20
2 files changed, 36 insertions, 0 deletions
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 17f1f7e1b06..a945e68aeb1 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -743,3 +743,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),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+insert into t1 values(default);
+ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column 'p' at row 1
+drop table t1;
+SET timestamp=default;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+alter table t1 add column i int;
+ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column 'p' at row 1
+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 2b834ac69a6..703a89b4065 100644
--- a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
@@ -743,3 +743,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),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+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),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+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;
+