1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-27 05:41:41 +03:00

MDEV-21792 Server aborts upon attempt to create foreign key on spatial field

- mbmaxlen is always 0 for binary field. Ignore the assert of checking
field->prefix_len % field->col->mbmaxlen == 0.
This commit is contained in:
Thirunarayanan Balathandayuthapani
2020-03-23 13:13:20 +05:30
parent 81f700015e
commit f7599f4799
4 changed files with 18 additions and 2 deletions

View File

@@ -522,3 +522,7 @@ test.t1 check status OK
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
# End of 10.2 tests
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
# End of 10.4 tests

View File

@@ -498,4 +498,12 @@ SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
--echo # End of 10.2 tests
# MDEV-21792 Server aborts upon attempt to create foreign key on spatial field
# Fail to create foreign key for spatial fields
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 (a GEOMETRY, INDEX(a(8)),
FOREIGN KEY (a) REFERENCES x (xx)) ENGINE=InnoDB;
-- echo # End of 10.4 tests
--source include/wait_until_count_sessions.inc