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

[HY000][1553] Changing name of primary key column with foreign key constraint fails.

Details

    Description

      Changing the name of a primary key column with a foreign key constraint fails with the following error since 10.4.13:

      [HY000][1553] (conn=17) Cannot drop index 'PRIMARY': needed in a foreign key constraint

      create schema test collate utf8_unicode_ci;
      create table test.input_type
      (
          input_type_id int(11) unsigned auto_increment
              primary key
      );
       
      create table test.input
      (
          input_id int unsigned auto_increment
              primary key,
          input_type_id int unsigned not null,
          constraint ibfk
              foreign key (input_type_id) references test.input_type (input_type_id)
      );
       
      create index type_id
          on test.input (input_type_id);
       
      alter table test.input_type change input_type_id id int(11) unsigned auto_increment;
      

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Alice Sherepa made transition -
            Open Confirmed
            1h 15m 1
            Alexander Barkov made transition -
            Confirmed In Progress
            295d 5h 40m 1
            Alexander Barkov made transition -
            In Progress Stalled
            1m 43s 1
            Alexander Barkov made transition -
            Stalled In Progress
            1s 1
            Alexander Barkov made transition -
            In Progress In Review
            7s 1
            Oleksandr Byelkin made transition -
            In Review Stalled
            12d 21h 14m 1
            Alexander Barkov made transition -
            Stalled Closed
            1d 6h 25m 1

            People

              bar Alexander Barkov
              mac89 Maarten Manders
              Votes:
              6 Vote for this issue
              Watchers:
              13 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.