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

Cannot add PK when identical UNIQUE key exists

Details

    Description

      Given there is an InnoDB table with no PK, and (at least) one unique key:

      CREATE TABLE test_tbl (
        col1 int(10) unsigned NOT NULL,
        UNIQUE KEY uniq (col1)
      ) ENGINE=innodb;
      

      Attempting to add a PK on the same columns:

      ALTER TABLE test_tbl ADD PRIMARY KEY(col1);
      

      Gives the following error:

      ERROR 1280 (42000): Incorrect index name 'uniq'
      

      and the PK is not created.

      This doesn't happen on latest 10.3 or latest 10.5 from dockerhub, only with 10.4

      Attachments

        Issue Links

          Activity

            dsech Dorian Sechesan created issue -

            Thanks for the report. We already have it filed as MDEV-19598, so let's keep tracking it there.

            elenst Elena Stepanova added a comment - Thanks for the report. We already have it filed as MDEV-19598 , so let's keep tracking it there.
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            Component/s Storage Engine - InnoDB [ 10129 ]
            Fix Version/s N/A [ 14700 ]
            elenst Elena Stepanova made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 108910 ] MariaDB v4 [ 157813 ]

            People

              Unassigned Unassigned
              dsech Dorian Sechesan
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.