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

Unexpected lock when UPDATE reports an error

    XMLWordPrintable

Details

    Description

      With "INSERT IGNORE", the INSERT executes successfully even though there is a NOT NULL constraint on column c1.

      In transaction, although the UPDATE executes unsuccessfully and reports an error, it locks the records and blocks other transaction.

      /* init */ CREATE TABLE t(c1 BLOB NOT NULL, c2 TEXT);
      /* init */ INSERT IGNORE INTO t VALUES (NULL, NULL), (NULL, 'aaa');
      /* t1 */ BEGIN;
      /* t1 */ UPDATE t SET c2='test' WHERE c1;
      /* t1 */ ERROR 1292 (22007): Truncated incorrect DOUBLE value: ''
      /* t2 */ BEGIN;
      /* t2 */ UPDATE t SET c2 = 'def'; -- t2 is blocked
      /* t1 */ COMMIT; -- t2 is unblocked
      /* t2 */ COMMIT;
      

      Attachments

        Activity

          People

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