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

DELETE fails to delete record after blocking is released

    XMLWordPrintable

Details

    Description

      Isolation Level: Read Committed & Read Uncommitted
      One transaction modifies a row, the other transaction concurrently deletes that row and is blocked. After blocking is released, the second transaction DELETE fails.

      /* init */ DROP TABLE IF EXISTS t;
      /* init */ CREATE TABLE t(c1 INT PRIMARY KEY, c2 INT);
      /* init */ INSERT INTO t(c1) VALUES (8);
       
      /* t1 */ BEGIN;
      /* t2 */ BEGIN;
      /* t1 */ UPDATE t SET c1 = 5, c2 = 5;
      /* t2 */ DELETE FROM t; -- blocked
      /* t1 */ UPDATE t SET c1 = 3;
      /* t1 */ COMMIT; -- t2 unblocked
      /* t2 */ SELECT * FROM t FOR UPDATE; -- [(3, 5)]
      /* t2 */ ROLLBACK;
      

      Attachments

        Issue Links

          Activity

            People

              vlad.lesin Vladislav Lesin
              John Jove John Jove
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.