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

mysqlbinlog fails to read binlog event which inserts timestamp with wrong number of microseconds

    XMLWordPrintable

Details

    Description

      In the test case below, note that f1 is TIMESTAMP(3), but the inserted value is NOW(). Apparently it's the most significant part.

      --source include/have_log_bin.inc
      --source include/have_binlog_format_row.inc
       
      --let $datadir= `SELECT @@datadir`
       
      DROP TABLE IF EXISTS `t1`;
      CREATE TABLE `t1` (
         `f1` timestamp(3) NOT NULL DEFAULT '2016-01-01 00:00:00.000',
         `f2` char(13) NOT NULL,
         `f3` decimal(7,2) DEFAULT NULL,
         `f4` char(8) DEFAULT NULL,
         `f5` decimal(5,2) DEFAULT NULL,
         PRIMARY KEY (`f1`,`f2`)
       ) DEFAULT CHARSET=utf8;
      INSERT INTO `t1` VALUES (NOW(),'-',0,'foo',0.0);
      FLUSH LOGS;
       
      --exec $MYSQL_BINLOG --verbose --base64-output=DECODE-ROWS $datadir/master-bin.000001
       
      DROP TABLE `t1`;

      Output

      ...
      /*!100001 SET @@session.gtid_seq_no=3*//*!*/;
      BEGIN
      /*!*/;
      # at 855
      # at 908
      #160216 21:22:01 server id 1  end_log_pos 908   Table_map: `test`.`t1` mapped to number 82
      #160216 21:22:01 server id 1  end_log_pos 957   Write_rows: table id 82 flags: STMT_END_F
      ### INSERT INTO `test`.`t1`
      ### SET
      ###   @1=-646528170
      ###   @2=''
      ###   @3=0
      ###   @4=''
      ###   @5=0
      ### INSERT INTO `test`.`t1`
      ### SET
      ###   @1=8417135
      ###   @2=NULL
      ###   @3=NULL
      ###   @4=''
      ###   @5=***Corrupted replication event was detected. Not printing the value***
      # at 957
      ...

      Note duplicate event, wrong values, and the corruption message.

      Reproducible on 5.5.48 and 10.0.23, as well as older versions that I checked (down to 10.0.11 at least); seems to be fixed in 10.1.

      Replication seems to work all right, so it's not absolutely critical, but it's very inconvenient when binlog events are important for problem investigation, so it would be good to fix it in 10.0 at least.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.