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

mysqldump does not maintain consistency of merge/underlying tables

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
    • 10.4, 10.5, 10.6
    • Scripts & Clients
    • None

    Description

      mysqldump may write CREATE statements related to a MERGE table before underlying tables which it unions. The merge table remains invalid until the underlying tables are created, so the dump can become unloadable.

      create table t (a int) engine=MyISAM;
      create table mt (a int) engine=MERGE union (t);
      create trigger tr after insert on mt for each row set @a= 1;
       
      --exec $MYSQL_DUMP test > $MYSQL_TMP_DIR/test.dump
      drop table mt, t;
      --exec $MYSQL test < $MYSQL_TMP_DIR/test.dump
       
      # Cleanup
      drop table mt;
      drop table t;
      

      10.3 0ca3aaa7

      ERROR 1168 (HY000) at line 38: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
      mysqltest: At line 7: exec of '/mnt8t/bld/10.3-nightly/bin/mysql --defaults-file=/mnt8t/bld/10.3-nightly/mysql-test/var/my.cnf test < /mnt8t/bld/10.3-nightly/mysql-test/var/tmp/test.dump' failed, error: 256, status: 1, errno: 11
      

      The line 38 in the dump is

      /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger tr after insert on mt for each row set @a= 1 */;;
      

      By this time, the MERGE table mt has already been created, but the underlying table t hasn't.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.