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

ER_NO_SUCH_TABLE_IN_ENGINE after failed CREATE OR REPLACE with FK violation

Details

    Description

      Since there is no obviously "right" behavior in cases like this, I won't object if it gets downgraded after the initial analysis. In my opinion the biggest problem here is that errors like ER_NO_SUCH_TABLE_IN_ENGINE make impression of data corruption.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT, KEY (a)) ENGINE=InnoDB;
      CREATE TABLE t2 (b INT, FOREIGN KEY (b) REFERENCES t1 (a)) ENGINE=InnoDB;
       
      SET STATEMENT FOREIGN_KEY_CHECKS=OFF FOR ALTER TABLE t1 MODIFY a VARCHAR(8);
       
      --error ER_CANT_CREATE_TABLE
      CREATE OR REPLACE TABLE t1 (c INT) ENGINE=InnoDB;
      SHOW CREATE TABLE t1;
       
      # Cleanup
      DROP TABLE t2, t1;
      

      bb-10.11-midenok 8e82c973eeb

      query 'SHOW CREATE TABLE t1' failed: ER_NO_SUCH_TABLE_IN_ENGINE (1932): Table 'test.t1' doesn't exist in engine
      

      Both pre-MDEV-25292 and the current 10.11 behave differently (older versions just drop t1 completely, and 10.11 pretends it gets re-created), so apparently this is already an effect of fixes pushed into bb-10.11-midenok.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            midenok Aleksey Midenkov made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            midenok Aleksey Midenkov made changes -
            Assignee Aleksey Midenkov [ midenok ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Michael Widenius [ monty ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.12 [ 28320 ]
            Fix Version/s 10.11 [ 27614 ]
            midenok Aleksey Midenkov made changes -
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 11.0 [ 28320 ]
            Assignee Michael Widenius [ monty ] Aleksey Midenkov [ midenok ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]

            People

              midenok Aleksey Midenkov
              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.