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

insert ... select ... can read latest data even under RR level #21506

Open
zyguan opened this issue Dec 4, 2020 · 1 comment
Open

insert ... select ... can read latest data even under RR level #21506

zyguan opened this issue Dec 4, 2020 · 1 comment
Assignees
Labels
severity/moderate sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug. type/compatibility

Comments

@zyguan
Copy link
Contributor

zyguan commented Dec 4, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

/* init */ drop table if exists t1, t2;
/* init */ create table t1 (id int primary key, v int);
/* init */ create table t2 (id int primary key, v int);
/* init */ insert into t1 values (1, 10), (2, 20);

/* t1 */ set session transaction isolation level repeatable read;
/* t1 */ begin;
/* t1 */ insert into t2 select * from t1;
/* t2 */ update t1 set id = id + 2;
/* t1 */ insert into t2 select * from t1; -- succeed
/* t1 */ select * from t2; -- (1, 10), (2, 20), (3, 10), (4, 20)
/* t1 */ commit;

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

Either t2 should be blocked or the second insert of t1 failed with duplicated error.

3. What did you see instead (Required)

The second insert of t1 succeed.

4. What is your TiDB version? (Required)

release-4.0 (2862cd7)

@zyguan zyguan added the type/bug The issue is confirmed as a bug. label Dec 4, 2020
@cfzjywxk cfzjywxk self-assigned this Dec 8, 2020
@jebter jebter added this to the v4.0.10 milestone Dec 11, 2020
@cfzjywxk
Copy link
Contributor

We need to discuss the expected behaviours for the insert select statement first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

No branches or pull requests

5 participants