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

Server crash in Docker on Windows when dropping a primary key referenced by a self-referencing foreign key

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.11
    • None
    • None
    • None
    • MariaDB version: 11.4.11-MariaDB-ubu2404
      Docker image: mariadb:11.4
      Host OS: Windows 11
      Runtime environment: Docker Desktop with WSL2 backend

    Description

      MariaDB crashes when executing ALTER TABLE ... DROP PRIMARY KEY on a table whose primary key is referenced by a self-referencing foreign key.

      The server should reject the operation with an error because the primary key is still required by the foreign key constraint. Instead, the server terminates and writes a core dump.

      How to repeat:

      CREATE TABLE t635 (c1 INT4 PRIMARY KEY);
      ALTER TABLE t635 ADD FOREIGN KEY (c1) REFERENCES t635(c1);
      ALTER TABLE t635 DROP PRIMARY KEY;
      

      Expected Result:
      The server should return an error indicating that the primary key cannot be dropped because it is referenced by a foreign key constraint.

      Actual Result:
      The MariaDB server crashes during execution of:
      ALTER TABLE t635 DROP PRIMARY KEY;

      Additional Information:

      The crash log contains:
      Writing a core file...

      The issue appears to be related to handling self-referencing foreign keys during primary key removal.

      Attachments

        Issue Links

          Activity

            People

              saahil Saahil Alam
              ss Songsong Wang
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.