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

ALTER TABLE DROP PK crashes on WSL

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.1.2
    • 10.4, 10.6
    • None

    Description

      Hi everyone,

      I am encountering the following problem:
      I have a database which consists of three tables: users, abonnements, and user_abonnements. users and abonnements have unique IDs and user_abonnements is used to model the relation between users and abonnements (see attachment dump.sql). Until each abonnement should now have a starting date (validFrom) and an end date (validTo), I add two columns using the following queries to the table:

      alter table user_abonnements
          add validFrom date not null;
       
      alter table user_abonnements
          add validTo date null;
      

      This works just fine. As a user can also subscribe to the same abonnement multiple times (after the first subscription has ended), I want to add "validFrom" to the primary key such that the columns userID, abonnementID, and validFrom are considered as the primary key. However, when trying to drop the current primary key (userID, abonnementID) of the table, the MariaDB-Server crashes (see docker.log) while executing the following query:

      alter table user_abonnements
          drop primary key;
      

      I think the server should return an error, stating that the primary key not be dropped because it is used for foreign keys instead of letting the server crash.

      Attachments

        1. docker.log
          25 kB
        2. docker-compose.yml
          0.3 kB
        3. dump.sql
          4 kB

        Issue Links

          Activity

            People

              danblack Daniel Black
              maaaak Marc Troll
              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.