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

Unexpected ER_WRONG_NAME_FOR_INDEX upon adding primary key on top of unique

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (pk INT NOT NULL, UNIQUE (pk)) ENGINE=InnoDB;
      ALTER TABLE t1 ADD PRIMARY KEY (pk);
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 5d2619b6

      mysqltest: At line 4: query 'ALTER TABLE t1 ADD PRIMARY KEY (pk)' failed: 1280: Incorrect index name 'pk'
      

      Not reproducible on 10.3.

      Attachments

        Issue Links

          Activity

            felixx Mariusz Felisiak added a comment - - edited

            In the Django's test suite we have a test "schema.tests.SchemaTests.test_alter_not_unique_field_to_primary_key" that fails due to this issue. I cannot bisect to a specific change, but it looks to be fixed in MariaDB 10.5.2 (I can still reproduce it on MariaDB 10.5.1).

            felixx Mariusz Felisiak added a comment - - edited In the Django's test suite we have a test "schema.tests.SchemaTests.test_alter_not_unique_field_to_primary_key" that fails due to this issue. I cannot bisect to a specific change, but it looks to be fixed in MariaDB 10.5.2 (I can still reproduce it on MariaDB 10.5.1).

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              2 Vote for this issue
              Watchers:
              4 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.