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

Not all autocommitted statements closed the transaction #21377

Closed
jackysp opened this issue Nov 30, 2020 · 1 comment · Fixed by #21378
Closed

Not all autocommitted statements closed the transaction #21377

jackysp opened this issue Nov 30, 2020 · 1 comment · Fixed by #21378
Labels
severity/critical sig/transaction SIG:Transaction type/bug The issue is confirmed as a bug.
Milestone

Comments

@jackysp
Copy link
Member

jackysp commented Nov 30, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

/* s1 */ create table t (i int);
/* s1 */ insert into t values (1);
/* s1 */ select * from t; /* got 1 */
/* s1 */ do @a := (select * from t where i = 1);
/* s2 */ insert into t values (2);
/* s1 */ select * from t /* got 1, should be 1, 2 */

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

The last statement should get "1, 2".

3. What did you see instead (Required)

It returns "1".

4. What is your TiDB version? (Required)

38324d3
#19106 introduced it.

@jackysp jackysp added the type/bug The issue is confirmed as a bug. label Nov 30, 2020
@cfzjywxk cfzjywxk added this to the v4.0.9 milestone Nov 30, 2020
@ti-srebot
Copy link
Contributor

ti-srebot commented Nov 30, 2020

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

#19106 move finishStmt in IsReadOnly branch, which makes do statement could not finish statement (close the transaction).

2. Symptom (optional)

After do statement, the transaction is not closed, which makes the next transaction could not get the right date.

3. All Trigger Conditions (optional)

autocommitted do statement, make sure it gets data from the storage (tikv) which could active a transaction. Then the next statement read some data.

4. Workaround (optional)

Do not use it. Maybe use set alternately.

5. Affected versions

[v4.0.8] master

6. Fixed versions

[v4.0.9] master

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

Successfully merging a pull request may close this issue.

4 participants