Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15833

Row format replication between LONGBLOB and MEDIUMBLOB does not work for long values

    XMLWordPrintable

    Details

      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).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: