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

After UPDATE of instant ADD COLUMN, PRIMARY KEY accepts duplicates

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
      CREATE TABLE t1 (t TEXT, PRIMARY KEY (t(1))) ENGINE=InnoDB;
      INSERT INTO t1 SET t='aa';
      ALTER TABLE t1 ADD COLUMN b INT;
      UPDATE t1 SET b = 1;
      INSERT INTO t1 SET t='ab';
      SELECT * FROM t1;
      DROP TABLE t1;
      

      The second INSERT should fail due to the duplicate column prefix key 'a', but instead the record will be inserted. With ROW_FORMAT=REDUNDANT the operation will fail as expected:

      mysqltest: At line 6: query 'INSERT INTO t1 SET t='ab'' failed: 1062: Duplicate entry 'a' for key 'PRIMARY'
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.