Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 11.8, 12.3, 13.0
-
None
Description
ALTER allows to add an empty geometry field to a table. mariadb-dump converts it into INSERT with an empty string, and upon an attempt to restore it it causes ER_CANT_CREATE_GEOMETRY_OBJECT (Cannot get geometry object from data you send to the GEOMETRY field).
CREATE TABLE t (a INT); |
INSERT INTO t VALUES (1); |
ALTER TABLE t ADD COLUMN g GEOMETRY NOT NULL; |
SHOW CREATE TABLE t; |
SELECT a, HEX(g), LENGTH(g) FROM t; |
--exec $MYSQL_DUMP test --tables t > $MYSQL_TMP_DIR/t.dump
|
DROP TABLE t; |
--exec $MYSQL test < $MYSQL_TMP_DIR/t.dump
|
|
|
SELECT a, HEX(g), LENGTH(g) FROM t; |
DROP TABLE t; |
|
10.11 46ee2066f06e45b3cb701feb35a8816b27ac31b8 |
Table Create Table |
t CREATE TABLE `t` ( |
`a` int(11) DEFAULT NULL, |
`g` geometry NOT NULL |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci |
SELECT a, HEX(g), LENGTH(g) FROM t; |
a HEX(g) LENGTH(g)
|
1 0
|
DROP TABLE t; |
bug.t [ fail ]
|
Test ended at 2026-08-10 13:21:50 |
|
|
CURRENT_TEST: bug.t
|
--------------
|
INSERT INTO `t` VALUES |
(1,'') |
--------------
|
ERROR 1416 (22003) at line 38: Cannot get geometry object from data you send to the GEOMETRY field |
mysqltest: At line 8: exec of '/10.11/mysql-test/var/my.cnf test < /10.11/mysql-test/var/tmp/t.dump' failed, error: 256, status: 1, errno: 11 |