[MDEV-30966] Replication stops with Column 1 of table 'test.D' cannot be converted from type 'geometry' to type 'blob' Created: 2023-03-29  Updated: 2023-04-03

Status: Open
Project: MariaDB Server
Component/s: Replication, Storage Engine - InnoDB
Affects Version/s: 10.6, 10.8, 10.9, 10.10, 10.11, 11.0
Fix Version/s: 10.6

Type: Bug Priority: Major
Reporter: Angelique Sklavounos (Inactive) Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I'm not sure if this is actually a replication problem or not. Before 10.6 with the test case below, the line

ALTER ONLINE TABLE `DD` RENAME TO t4, ADD geocol4 GEOMETRY DEFAULT ST_GEOMFROMTEXT('Point(1 1)');

doesn't error, and the subsequent commands error. But in 10.6 and above, it errors with:

ERROR 23000: Can't write; duplicate key in table 'mysql.innodb_table_stats'

and the remaining commands execute.

To reproduce

--source include/have_innodb.inc
--source include/master-slave.inc
--source include/have_binlog_format_row.inc
--disable_abort_on_error
 
--connection master
USE test;
CREATE OR REPLACE SEQUENCE `A` Engine=InnoDB;
CREATE TABLE t4 LIKE `A`;
# this errors but is needed for replication failure
ALTER ONLINE TABLE t4 ADD CONSTRAINT g CHECK (icol5 > 3), DROP CONSTRAINT w, DROP CONSTRAINT v, ADD CONSTRAINT h PRIMARY KEY(icol2), ALGORITHM=DEFAULT, LOCK=NONE;
CREATE OR REPLACE TABLE t4 (scol9 BLOB DEFAULT '' CHECK (`col_int_key` LIKE tcol1) ) Engine=InnoDB;
CREATE OR REPLACE TABLE `DD` (geocol9 POLYGON ) Engine=InnoDB;
ALTER ONLINE TABLE `DD` RENAME TO t4, ADD geocol4 GEOMETRY DEFAULT ST_GEOMFROMTEXT('Point(1 1)');
ALTER TABLE `DD` RENAME TO `D`;
ALTER TABLE `D` ADD IF NOT EXISTS `col_varchar_key` BLOB NULL DEFAULT NULL, LOCK=SHARED;
INSERT INTO `D` () VALUES (),(),();
--connection slave
--let $status_items= Last_SQL_Error, Slave_SQL_Running
--source include/show_slave_status.inc
--let $slave_param= Slave_SQL_Running
--let $slave_param_value= Yes
--source include/check_slave_param.inc
--connection master
DROP DATABASE test;
CREATE DATABASE test;
--source include/rpl_end.inc


Generated at Thu Feb 08 10:20:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.