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"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            ratzpo Rasmus Johansson added a comment -

            Re: Spurious `use` statements in output from mysqlbinlog -rewrite-db="a>b"
            rewrite-db has not been ported to PS 5.5 yet, marking it as triaged for 5.5.

            Show
            ratzpo Rasmus Johansson added a comment - Re: Spurious `use` statements in output from mysqlbinlog - rewrite-db="a >b" rewrite-db has not been ported to PS 5.5 yet, marking it as triaged for 5.5.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 702303

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 702303
            Hide
            ratzpo Rasmus Johansson added a comment -

            I believe this was fixed long time ago

            Show
            ratzpo Rasmus Johansson added a comment - I believe this was fixed long time ago

              People

              • Assignee:
                knielsen Kristian Nielsen
                Reporter:
                knielsen Kristian Nielsen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: