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

Server aborts during alter operation when table doesn't have foreign index

    XMLWordPrintable

Details

    Description

      InnoDB fails to find the foreign key index for the foreign key relation
      in the table while iteration the foreign key constraints.
      This is caused by commit 5f09b53bdb4e973e7c7ec2c53a24c98321223f98 (MDEV-31086).

      Test case to repeat the issue:

      --source include/have_innodb.inc
      SET FOREIGN_KEY_CHECKS=0;
      CREATE TABLE t1 (f1 INT NOT NULL, INDEX(f1)) ENGINE=InnoDB;
      CREATE TABLE t2(f1 INT NOT NULL, f2 VARCHAR(100) DEFAULT NULL,
                      INDEX idx(f1, f2),
                      FOREIGN KEY(f1) REFERENCES t1(f1))ENGINE=INNODB;
      ALTER TABLE t2 DROP INDEX idx;
      ALTER TABLE t2 MODIFY f2 VARCHAR(1023);
      DROP TABLE t2, t1;
      

      Fix:
      ===
      In check_col_is_in_fk_indexes(), while iterating through
      the foreign key relationship, InnoDB should consider that
      foreign key relation may not have foreign index when
      foreign key check is disabled.

      Attachments

        Issue Links

          Activity

            People

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