Skip to content

Commit 8e255b9

Browse files
author
Alexey Botchkov
committed
MDEV-13923 Assertion `!is_set() || (m_status == DA_OK_BULK &&
is_bulk_op())' failed upon altering table with geometry field. Tests added.
1 parent fe0d2e1 commit 8e255b9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

mysql-test/suite/innodb_gis/r/alter_spatial_index.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,3 +740,19 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p);
740740
ALTER TABLE t1 FORCE, LOCK=NONE;
741741
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
742742
DROP TABLE t1;
743+
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
744+
set timestamp=10;
745+
insert into t1 values(default);
746+
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
747+
drop table t1;
748+
SET timestamp=default;
749+
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
750+
set timestamp=10;
751+
alter table t1 add column i int;
752+
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
753+
drop table t1;
754+
SET timestamp=default;
755+
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
756+
ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0';
757+
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
758+
DROP TABLE t1;

mysql-test/suite/innodb_gis/t/alter_spatial_index.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,3 +739,23 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p);
739739
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
740740
ALTER TABLE t1 FORCE, LOCK=NONE;
741741
DROP TABLE t1;
742+
743+
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
744+
set timestamp=10;
745+
--error ER_CANT_CREATE_GEOMETRY_OBJECT
746+
insert into t1 values(default);
747+
drop table t1;
748+
SET timestamp=default;
749+
750+
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),0)) ENGINE=innodb;
751+
set timestamp=10;
752+
--error ER_CANT_CREATE_GEOMETRY_OBJECT
753+
alter table t1 add column i int;
754+
drop table t1;
755+
SET timestamp=default;
756+
757+
CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
758+
--error ER_CANT_CREATE_GEOMETRY_OBJECT
759+
ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0';
760+
DROP TABLE t1;
761+

0 commit comments

Comments
 (0)