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

Weird read view after ROLLBACK of other transactions.

    XMLWordPrintable

Details

    Description

      How to repeat:

      /* init */ CREATE TABLE t(a INT PRIMARY KEY, b INT UNIQUE);
      /* init */ INSERT INTO t(a) VALUES (1);
      /* t1 */ SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
      /* t2 */ SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
       
      /* t1 */ BEGIN;
      /* t2 */ BEGIN;
      /* t1 */ INSERT INTO t(a) VALUES (2);
      /* t2 */ SELECT a, b FROM t WHERE TRUE;  -- [(1, null), (1, null)]
      /* t1 */ ROLLBACK;
      /* t2 */ COMMIT;
      

      The SELECT statement of t2 was initially blocked by t1. Then it recovered after t1's ROLLBACK, but its query result contained two identical records (1, null). Interestingly, removing the UNIQUE constraint on column b eliminates this anomaly.

      Attachments

        Issue Links

          Activity

            People

              vlad.lesin Vladislav Lesin
              zhuangliu Zhuang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.