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

Multi-line statement Annotate rows event gets truncated

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.8, 10.2, 10.3, 10.4
    • 10.4
    • Scripts & Clients
    • None
    • Linux CentOS 7.6

    Description

      The commented SQL statement in the output from mariadb-binlog get's truncated with a few characters when the SQL statement is multi-line and binlog format ROW is used.
      To reproduce:

      MariaDB [test]> create table t1(c1 varchar(10));
      Query OK, 0 rows affected (0.323 sec)
       
      MariaDB [test]> insert into t1 values('Row 1');
      Query OK, 1 row affected (0.049 sec)
       
      MariaDB [test]> insert into t1 values('Row 2'),
          -> ('Row 3');
      Query OK, 2 rows affected (0.140 sec)
      Records: 2  Duplicates: 0  Warnings: 0
      

      Now look at the binlog with mariadb-binlog, and the output (an extract) looks like this:

      #191206 14:33:46 server id 100  end_log_pos 1472 CRC32 0x05e963a5       Annotate_rows:
      #Q> insert into t1 values('Row 1')
      #191206 14:33:46 server id 100  end_log_pos 1519 CRC32 0x7cfec504       Table_map: `test`.`t1` mapped to number 30
      # at 1519
      #191206 14:33:46 server id 100  end_log_pos 1559 CRC32 0x9ab57731       Write_rows: table id 30 flags: STMT_END_F
       
      BINLOG '
      uljqXRNkAAAALwAAAO8FAAAAAB4AAAAAAAEABHRlc3QAAnQxAAEPAgoAAQTF/nw=
      uljqXRdkAAAAKAAAABcGAAAAAB4AAAAAAAEAAf/+BVJvdyAxMXe1mg==
      '/*!*/;
      # Number of rows: 1
      # at 1559
      #191206 14:33:46 server id 100  end_log_pos 1590 CRC32 0x959ad94b       Xid = 57
      COMMIT/*!*/;
      # at 1590
      #191206 14:33:56 server id 100  end_log_pos 1632 CRC32 0x9dbd1c81       GTID 0-100-220877 trans
      /*!100001 SET @@session.gtid_seq_no=220877*//*!*/;
      BEGIN
      /*!*/;
      # at 1632
      # at 1696
      #191206 14:33:56 server id 100  end_log_pos 1696 CRC32 0x323317ba       Annotate_rows:
      #Q> insert into t1 values('Row 2'),
      #Q> ('Row 3'
      #191206 14:33:56 server id 100  end_log_pos 1743 CRC32 0xc497312c       Table_map: `test`.`t1` mapped to number 30
      

      As can be seen, the last insert in the output has the second line truncated and is missing a closing quite and a parentetis.

      Attachments

        Activity

          People

            Elkin Andrei Elkin
            karlsson Anders Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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