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

CREATE OR REPLACE TRIGGER which fails on PRECEDES/FOLLOWS drops the trigger, but isn't written to binlog; replication fails

    XMLWordPrintable

Details

    Description

      --source include/master-slave.inc
      --source include/have_binlog_format_mixed.inc
       
      CREATE TABLE t1 (i INT);
       
      CREATE OR REPLACE TRIGGER tr BEFORE INSERT ON t1 FOR EACH ROW SET @a=1;
      --error ER_REFERENCED_TRG_DOES_NOT_EXIST
      CREATE OR REPLACE TRIGGER tr BEFORE DELETE ON t1 FOR EACH ROW PRECEDES non_existing_trigger SET @a=2;
      SHOW TRIGGERS;
       
      --sync_slave_with_master
      SHOW TRIGGERS;
      

      Result of this test case is that master and slave go out of sync: master has no triggers, but slave still has tr.
      That's because when CREATE OR REPLACE TRIGGER, it still drops the trigger, but nothing is written to the binary log.

      It's possible that the underlying problem exists in earlier versions, but I couldn't reproduce it with a few other errors which can happen on trigger re-creation.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.