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

Reversed executable comments incorrectly written in binlog and could break replication

    XMLWordPrintable

Details

    Description

      --source include/master-slave.inc
      --source include/have_log_bin.inc
       
       
      CREATE TABLE t1 /*!140000  comment */ (a INT);
      CREATE TABLE t2 /*!!100000  comment */ (a INT);
       
      show binlog events;
       
      --sync_slave_with_master
       
      --connection master
      drop table t1,t2;
       
      --sync_slave_with_master
       
      --source include/rpl_end.inc
      

      include/master-slave.inc
      [connection master]
      CREATE TABLE t1 /*!140000  comment */ (a INT);
      CREATE TABLE t2 /*!!100000  comment */ (a INT);
      show binlog events;
      Log_name	Pos	Event_type	Server_id	End_log_pos	Info
      master-bin.000001	4	Format_desc	1	257	Server ver: 13.0.1-MariaDB-asan-debug-log, Binlog ver: 4
      master-bin.000001	257	Gtid_list	1	286	[]
      master-bin.000001	286	Binlog_checkpoint	1	330	master-bin.000001
      master-bin.000001	330	Gtid	1	372	GTID 0-1-1
      master-bin.000001	372	Query	1	493	use `test`; CREATE TABLE t1 /* 140000  comment */ (a INT)
      master-bin.000001	493	Gtid	1	535	GTID 0-1-2
      master-bin.000001	535	Query	1	657	use `test`; CREATE TABLE t2 /*! 100000  comment */ (a INT)
      main.1_my 'mix'                          [ fail ]
      .....
      Last_SQL_Error	Error 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '100000  comment */ (a INT)' at line 1' on query. Default database: 'test'. Query: 'CREATE TABLE t2 /*! 100000  comment */ (a INT)'
      

      note that in executable comment ! sign disappears during logging, but with !! -> the reversed comment is treated as executable on slave

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.