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

Unexpected ER_ERROR_ON_RENAME upon DROP non-existing FOREIGN KEY with ALGORITHM=COPY

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      --error ER_CANT_DROP_FIELD_OR_KEY
      ALTER TABLE t1 DROP FOREIGN KEY x, ALGORITHM=COPY;
       
      # Cleanup
      DROP TABLE t1;
      

      10.5 8c0b9880

      query 'ALTER TABLE t1 DROP FOREIGN KEY x, ALGORITHM=COPY' failed with wrong errno 1025: 'Error on rename of './test/t1' to './test/#sql2-10fa-4' (errno: 152 "Cannot delete a parent row")', instead of 1091...
      

      Without ALGORITHM=COPY it fails with ER_CANT_DROP_FIELD_OR_KEY as expected.

      There is an ancient upstream bug https://bugs.mysql.com/bug.php?id=14347 which seems related, but I'm not sure it's quite the same.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.