[MDEV-15833] Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values Created: 2018-04-10  Updated: 2018-11-19  Resolved: 2018-04-10

Status: Closed
Project: MariaDB Server
Component/s: Data types, Replication
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.15

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-15821 Row format replication from LONGBLOB ... Closed

 Description   

This bug is similar to MDEV-15821, but now for regular non-compressed column types, and it's repeatable starting from 10.2.

I run this mtr test which replicates a long value (>64K) from MEDIUMBLOB to LONGBLOB.

-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
 
let mst=MEDIUMBLOB;
let slv=LONGBLOB;
let val=REPEAT('a',66000);
 
#let mst=LONGBLOB;
#let slv=MEDIUMBLOB;
#let val=REPEAT('a',66000);
 
 
connection master;
SET sql_mode='';
 
--eval CREATE TABLE t1 (a $mst);
 
sync_slave_with_master;
connection slave;
SET @tmp=@@GLOBAL.SLAVE_TYPE_CONVERSIONS;
eval SET @@GLOBAL.SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY,ALL_LOSSY';
--eval ALTER TABLE t1 MODIFY a $slv;
 
connection master;
--eval INSERT INTO t1 (a) VALUES ($val);
SELECT LENGTH(a) FROM t1;
 
sync_slave_with_master;
SHOW CREATE TABLE t1;
SELECT LENGTH(a) FROM t1;
 
connection master;
DROP TABLE t1;
 
sync_slave_with_master;
connection slave;
SET @@GLOBAL.SLAVE_TYPE_CONVERSIONS=@tmp;
 
connection master;
SET sql_mode=DEFAULT;
 
--source include/rpl_end.inc

It prints the following output:

==============================================================================
 
TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------
 
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
include/master-slave.inc
[connection master]
connection master;
SET sql_mode='';
CREATE TABLE t1 (a MEDIUMBLOB);;
connection slave;
connection slave;
SET @tmp=@@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET @@GLOBAL.SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY,ALL_LOSSY';
ALTER TABLE t1 MODIFY a LONGBLOB;;
connection master;
INSERT INTO t1 (a) VALUES (REPEAT('a',66000));;
SELECT LENGTH(a) FROM t1;
LENGTH(a)
66000
connection slave;
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `a` longblob DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT LENGTH(a) FROM t1;
LENGTH(a)
65535
connection master;
DROP TABLE t1;
connection slave;
connection slave;
SET @@GLOBAL.SLAVE_TYPE_CONVERSIONS=@tmp;
connection master;
SET sql_mode=DEFAULT;
include/rpl_end.inc
rpl.AAA02 'row'                          [ pass ]   1222
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 1.222 of 6 seconds executing testcases
 
Completed: All 1 tests were successful.

Notice, the value length on the master is 66000 and 65535 on the slave.

Note, the problem is also repeatable if I change the script to replicate the other way around (from LONGBLOB to MEDIUMBLOB).


Generated at Thu Feb 08 08:24:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.