Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird SELECT when table has the primary key #33316

Closed
sayJason opened this issue Mar 22, 2022 · 1 comment
Closed

Weird SELECT when table has the primary key #33316

sayJason opened this issue Mar 22, 2022 · 1 comment
Labels
type/bug The issue is confirmed as a bug.

Comments

@sayJason
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

/* init */ CREATE TABLE t (c1 INT PRIMARY KEY, c2 INT);
/* init */ INSERT INTO t (c1, c2) VALUES (1, 1);

/* t1 */ BEGIN;
/* t1 */ UPDATE t SET c1=2, c2=2;
/* t2 */ BEGIN;
/* t2 */ DELETE FROM t;  -- t2 blocked
/* t1 */ COMMIT;  -- t2 unblocked
/* t2 */ SELECT * FROM t;
/* t2 */ COMMIT;

2. What did you expect to see? (Required)

The result of SELECT statement in the second transaction should get an empty set.

3. What did you see instead (Required)

The result of SELECT statement in the second transaction is (1, 1).

It is weird that SELECT statement is not empty only if table has the primary key.

4. What is your TiDB version? (Required)

+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v5.4.0 |
+--------------------+
@sayJason sayJason added the type/bug The issue is confirmed as a bug. label Mar 22, 2022
@morgo
Copy link
Contributor

morgo commented Mar 22, 2022

Closing as a duplicate of #33315

@morgo morgo closed this as completed Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants