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

LP:702303 - Spurious `use` statements in output from mysqlbinlog --rewrite-db="a->b"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      This bug was introduced with the implementation of MWL#36.

      Normally, mysqlbinlog suppresses output of `use` statements before statements
      like BEGIN, COMMIT, SAVEPOINT, ROLLBACK, as they are not needed.

      However, this suppression does not happen when the MWL#36 --rewrite-db option
      affects the current database.

      Test case:

      – source include/have_binlog_format_statement.inc
      – source include/have_log_bin.inc
      – source include/have_innodb.inc
      let $MYSQLD_DATADIR= `select @@datadir`;
      create table t1 (a int primary key) engine=innodb;
      create database test2;
      RESET MASTER;
      use test2;
      begin;
      use test;
      insert into t1 values (1);
      use test2;
      commit;
      begin;
      use test;
      insert into t1 values (2);
      use test2;
      commit;
      use test;
      select * from t1 order by a;
      flush logs;
      --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --short-form
      -exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --short-form --rewrite-db="test>foo" -rewrite-db="test2>bar"
      drop database test2;
      drop table t1;

      The expected output is that each mysqlbinlog run should output a single `use`
      statement, just before the first INSERT. However, currently, the second run
      outputs extra `use` statements around the begin/commit statements.

      I will commit a fix for 5.2.

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            knielsen Kristian Nielsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.