-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
remove read-only statement from transaction auto retry (#5026) #5051
Conversation
LGTM |
@wentaoxu please fix the error. |
executor/compiler.go
Outdated
return &ExecStmt{ | ||
InfoSchema: infoSchema, | ||
Plan: finalPlan, | ||
Expensive: stmtCount(stmtNode, finalPlan, ctx.GetSessionVars().InRestrictedSQL), | ||
Cacheable: plan.Cacheable(stmtNode), | ||
Text: stmtNode.Text(), | ||
ReadOnly: ast.IsReadOnly(readOnlyCheckStmt), | ||
// this should not be 'plan.execute' | ||
ReadOnly: ast.IsReadOnly(stmtNode), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be plan.Execute
There are two types of prepared statement binary and text.
@wentaoxu Any update? |
* *: Ignore readonly statement when retrying * remove explain statement from retry * remove all select statement from retry except It has setvar functions * remove execute statement from retry if it is read-only statement
f4b3d6a
to
39d7430
Compare
PTAL @coocood, I get the prepared ast from session context and check if the ast is read-only. if plan cache merge into release-1.0, these codes can be deleted. |
LGTM |
/run-all-tests tikv=release-1.0 tidb-test=release-1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
*: Ignore readonly statement when retrying
remove explain statement from retry
remove all select statement from retry except It has setvar functions
remove execute statement from retry if it is read-only statement