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

Duplicate values upon InnoDB bulk insert cause complete silent rollback

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.7(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2, 11.3(EOL)
    • 10.11, 11.2
    • None

    Description

      --source include/have_innodb.inc
       
      create table t (a int) engine=InnoDB;
      insert into t values (1),(2),(1);
       
      create table t1 (a int unique) engine=InnoDB;
      SET unique_checks=0, foreign_key_checks=0;
      insert into t1 select * from t;
      SET unique_checks=1, foreign_key_checks=1;
      select * from t1;
       
      # Cleanup
      drop table t, t1;
      

      10.7.8

      create table t (a int) engine=InnoDB;
      insert into t values (1),(2),(1);
      create table t1 (a int unique) engine=InnoDB;
      SET unique_checks=0, foreign_key_checks=0;
      insert into t1 select * from t;
      SET unique_checks=1, foreign_key_checks=1;
      select * from t1;
      a
      drop table t, t1;
      

      So, the table ends up empty, but there are no hints for the user that the operation didn't succeed.
      Reproducible on 10.7+. 10.6 returns a duplicate key error.
      According to marko, it was likely induced by MDEV-24621.

      It is somewhat similar to MDEV-31985 in the sense that the table ends up empty, however in MDEV-31985 INSERT IGNORE is used, and it at least produces a warning.

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.