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

replicate-rewrite-db doesn't work on functions with STATEMENT binlog

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.1.18, 5.5, 10.0, 10.1, 10.2
    • N/A
    • Replication
    • ubuntu trusty

    Description

      Create a master replication server with variable binlog_format=STATEMENT
      On the master

      create database mariadb_repl_bug;
      

      Create a slave replication server with settings:

      [mysqld]
      repl_bug.replicate-rewrite-db=mariadb_repl_bug->m_bug_repl
      repl_bug.replicate-do-db  = m_bug_repl
      

      On the slave

      create database m_bug_repl;
      

      Setup replication on the slave named 'repl_bug'

      On the master execute:

      create table test (id integer(11) not null primary key auto_increment, val varchar(25));
      delimiter ;;
      create function show_but() returns integer(11)
      begin
        insert into test (val) value('hello');
        return last_insert_id();
      end;;
      delimiter ;
      

      At this point there should be one table and one procedure in db mariadb_repl_bug on the master and m_bug_repl.

      Now on the master execute:

      use  mariadb_repl_bug;
      select show_but();
      

      The replication on the slave will then stop with error:

      Error 'FUNCTION mariadb_repl_bug.show_but does not exist' on query. Default database: 'm_bug_repl'. Query: 'SELECT `mariadb_repl_bug`.`show_but`()'
      

      If you create the database mariadb_repl_bug and the function than the error will change to duplicate key.

      In both cases this is incorrect behaviour. The slave should rewrite the db on calling the function also.

      Attachments

        Activity

          People

            sachin.setiya.007 Sachin Setiya (Inactive)
            lukav Anton Avramov
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.