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

INSERT DELAYED treated as usual INSERT if table has check constraints

    XMLWordPrintable

Details

    Description

      create table t1 (a int primary key, check(a<10)) engine=MyISAM;
      insert delayed into t1 values (1),(1);
       
      # cleanup
      drop table t1;
      

      INSERT DELAYED above results in the error:

      10.2 3f12a596

      At line 2: query 'insert delayed into t1 values (1),(1)' failed: 1062: Duplicate entry '1' for key 'PRIMARY'
      

      It shouldn't be happening if it is treated as INSERT DELAYED. If we remove CHECK from the table definition, INSERT DELAYED doesn't return the error.

      The fact that DELAYED is ignored can also be observed in a more intuitive situation, if you lock the table in another client connection. Naturally INSERT DELAYED should return immediately, but with CHECK on the table it doesn't.

      Reproducible with table-level and column-level check constraints, on 10.2-10.5.

      Note:
      It may be intentional, and if it was not, it might not be worth fixing. In this case, please re-categorize as Documentation issue, so that it's mentioned as a limitation in the documentation for CHECK constraints and for INSERT DELAYED, and reassign accordingly.

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.