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

The second SELECT statement reports "Record has changed since last read in table 't'" error at Serializable

    XMLWordPrintable

Details

    Description

      Isolation Level: Serializable.
      At the serializable isolation level, the second SELECT statement reports "Record has changed since last read in table 't'" error when the WHERE condition of the first SELECT statement is evaluated as false.

      /* init */ DROP TABLE IF EXISTS t;
      /* init */ CREATE TABLE t (c1 INT);
      /* init */ INSERT INTO t(c1) VALUES (1);
       
      /* t1 */ BEGIN;
      /* t2 */ BEGIN;
      /* t2 */ SELECT * FROM t WHERE FALSE;
      /* t1 */ INSERT INTO t(c1) VALUES (2);
      /* t1 */ COMMIT;
      /* t2 */ SELECT * FROM t ;
      ERROR 1020 (HY000): Record has changed since last read in table 't'
      /* t2 */ COMMIT;
      

      The expectation is that the second SELECT statement can retrieve [(1), (2)]. However, in actual execution, the second SELECT statement in transaction t2 failed to execute and reported an error "Record has changed since last read in table 't'" when the WHERE condition of the first SELECT statement was evaluated as false.

      Attachments

        Activity

          People

            saahil Saahil Alam
            John Jove John Jove
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.