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

SELECT statement is affected by concurrent transaction under Read Uncommitted

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2026 Server Maintenance

    Description

      Isolation Level: Read Uncommitted.
      The SELECT statement is affected by the blocked statement in another concurrent transaction.

      /* init */ DROP TABLE IF EXISTS t;
      /* init */ CREATE TABLE t(c1 INT NOT NULL, c2 INT NOT NULL);
      /* init */ INSERT INTO t(c1,c2) VALUES (2, 2);
       
      /* t1 */ BEGIN;
      /* t2 */ BEGIN;
      /* t2 */ INSERT INTO t(c1,c2) VALUES (5, 5);
      /* t2 */ SELECT * FROM t; -- [(2, 2), (5, 5)]
      /* t1 */ SELECT * FROM t; -- [(2, 2), (5, 5)]
      /* t1 */ DELETE FROM t WHERE TRUE; -- blocked
      /* t2 */ SELECT * FROM t ; -- [(5, 5)]
      /* t2 */ COMMIT; -- t1 unblocked
      /* t1 */ COMMIT;
      

      When the DELETE statement in transaction t1 is blocked, strangely, the second SELECT statement in transaction t2 only retrieved (5, 5), but failed to retrieve (2, 2).

      Attachments

        Activity

          People

            andrzej.jarzabek Andrzej Jarzabek
            John Jove John Jove
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1.55d
                1.55d
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1d Time Not Required
                1d

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.