Update with sub query uses incorrect snapshot in RR isolation level #45677
Labels
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
may-affects-7.5
may-affects-8.1
severity/major
sig/transaction
SIG:Transaction
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
init database with 1 row as below.
Then start two session and update that row in session2 after session1 starts a transaction.
Then execute a update with sub query in session1.
2. What did you expect to see? (Required)
The last select returns:
3. What did you see instead (Required)
The last select returns:
We also check the behaviour of normal update in the case below.
Then it returns:
as expected.
Note that
update t set b=3 where b=2;
andupdate t set b=3 where b=(select b from t where b=2);
have the same meaning in these two cases. It;s confusing to have different results.4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: