Skip to content

[Bug]: Repeatable Read(Snapshot Isolation) Bug In MemEngine #5388

Closed

Description

@JackTan25

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

terminal 1:
mysql> create database test;use test;
Query OK, 0 rows affected (0.01 sec)

Database changed
mysql> create table t(a int,b int);insert into t values(10,10);
Query OK, 0 rows affected (0.04 sec)

Query OK, 1 row affected (0.04 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> update t set a = a -1;
Query OK, 1 row affected (0.04 sec)

mysql> update t set b = b + 1;
Query OK, 1 row affected (0.03 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

terminal 2:
mysql> use test;
Database changed
mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from t; // select before commit.
+------+------+
| a | b |
+------+------+
| 10 | 10 |
+------+------+
1 row in set (0.03 sec)

mysql> select * from t; // select after commit. obey 'repeatable read'
Empty set (0.04 sec)

Expected Behavior

terminal 1:
mysql> create database test;use test;
Query OK, 0 rows affected (0.01 sec)

Database changed
mysql> create table t(a int,b int);insert into t values(10,10);
Query OK, 0 rows affected (0.04 sec)

Query OK, 1 row affected (0.04 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> update t set a = a -1;
Query OK, 1 row affected (0.04 sec)

mysql> update t set b = b + 1;
Query OK, 1 row affected (0.03 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

terminal 2:
mysql> use test;
Database changed
mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from t; // select before commit.
+------+------+
| a | b |
+------+------+
| 10 | 10 |
+------+------+
1 row in set (0.03 sec)

mysql> select * from t; // select after commit.
+------+------+
| a | b |
+------+------+
| 10 | 10 |
+------+------+
1 row in set (0.03 sec)

Steps to Reproduce

No response

Additional information

No response

Activity

  1. added
    kind/bug
    on Oct 2, 2022
  2. self-assigned this
    on Oct 3, 2022
  3. added a commit that references this issue on Oct 5, 2022
  4. added a commit that references this issue on Oct 5, 2022
  5. added
    severity/s1
    and removed on Oct 29, 2022
  6. added this to the v0.6.0 milestone on Oct 29, 2022
  7. domingozhang commented on Nov 2, 2022

    @domingozhang
    Contributor

    Now all queries are '10 10' now whether before or after commit;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s1

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions