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

CREATE INDEX on temporary table breaks replication slaves

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.2.9
    • N/A
    • Replication
    • None
    • CentOS 7.4

    Description

      When attempting to create an index on a temporary table, replication on any slaves breaks with a "table does not exist" error. This is easy to reproduce. With a master and slave set up with GTID (not sure if this matters - did not test non-GTID replication) and async replication, run the following statements:

      CREATE TEMPORARY TABLE `t3` (`c1` INT, `c2` INT, PRIMARY KEY(`c1`)) ENGINE=InnoDB;
      CREATE INDEX `idx1` ON `t3` (`c2`);
      DROP TEMPORARY TABLE `t3`;

      You will find that replication on the slave has broken with the following error:

      Error 'Table 'test.t3' doesn't exist' on query. Default database: 'test'. Query: 'CREATE INDEX `idx1` ON `t3` (`c2`)'

      Curiously enough, this only seems to be an issue with CREATE INDEX. This can be observed with the following statements, which do not break replication:

      CREATE TEMPORARY TABLE `t3` (`c1` INT, `c2` INT, PRIMARY KEY(`c1`)) ENGINE=InnoDB;
      ALTER TABLE `t3` ADD INDEX `idx1` (`c2`);
      DROP TEMPORARY TABLE `t3`;

      This is especially curious as the manual suggests that CREATE INDEX is merely syntactic sugar for ALTER TABLE.

      Ideally, CREATE INDEX would not break replication slaves when used on temporary tables.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              neiltembo Neil Skrypuch
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.