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

DDL statements do not replicate when replicate-rewrite-db is set

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 10.0.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Create a replication from server A db1 to Server B db2 using replicate-rewrite-db=db1->db2

      Create a table in db1 on server A called tbl1, the table is not created on server B in db2.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Works all right for me. Here is the test case, you can use it literally in MTR or interpret as "steps to reproduce":

            --source include/master-slave.inc
            --enable_connect_log

            --connection slave
            CREATE DATABASE db2;

            --connection master
            CREATE DATABASE db1;
            USE db1;
            CREATE TABLE tbl1 (i INT);

            --sync_slave_with_master

            SHOW DATABASES;
            SHOW TABLES IN db2;

            1. End of test case

            Output:

            [connection master]
            connection slave;
            CREATE DATABASE db2;
            connection master;
            CREATE DATABASE db1;
            USE db1;
            CREATE TABLE tbl1 (i INT);
            connection slave;
            SHOW DATABASES;
            Database
            db1
            db2
            information_schema
            mtr
            mysql
            performance_schema
            test
            SHOW TABLES IN db2;
            Tables_in_db2
            tbl1

            1. End of output

            Are you sure you are setting the default database to db1 before trying to replicate, i.e. you do "USE db1"? That's the mandatory condition for this option, if you instead do something like
            CREATE DATABASE db1;
            CREATE TABLE db1.tbl1(i INT);

            it's not supposed to work, by the definition of the option.

            Show
            elenst Elena Stepanova added a comment - Works all right for me. Here is the test case, you can use it literally in MTR or interpret as "steps to reproduce": --source include/master-slave.inc --enable_connect_log --connection slave CREATE DATABASE db2; --connection master CREATE DATABASE db1; USE db1; CREATE TABLE tbl1 (i INT); --sync_slave_with_master SHOW DATABASES; SHOW TABLES IN db2; End of test case Output: [connection master] connection slave; CREATE DATABASE db2; connection master; CREATE DATABASE db1; USE db1; CREATE TABLE tbl1 (i INT); connection slave; SHOW DATABASES; Database db1 db2 information_schema mtr mysql performance_schema test SHOW TABLES IN db2; Tables_in_db2 tbl1 End of output Are you sure you are setting the default database to db1 before trying to replicate, i.e. you do "USE db1"? That's the mandatory condition for this option, if you instead do something like CREATE DATABASE db1; CREATE TABLE db1.tbl1(i INT); it's not supposed to work, by the definition of the option.
            Hide
            elenst Elena Stepanova added a comment -

            If the notes above do not explain the problem you were experiencing, please comment and we will re-open the report if necessary.

            Show
            elenst Elena Stepanova added a comment - If the notes above do not explain the problem you were experiencing, please comment and we will re-open the report if necessary.

              People

              • Assignee:
                elenst Elena Stepanova
                Reporter:
                mike.ashton Mike Ashton
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: