-
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
server,session: code refactor for multiple statements in one query #16056 #22451
Conversation
LGTM |
LGTM |
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
/merge |
Sorry @xhebox, this branch cannot be merged without an approval of release maintainers. |
/merge |
Sorry @tiancaiamao, this branch cannot be merged without an approval of release maintainers. |
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
/merge |
Sorry @AilinKid, this branch cannot be merged without an approval of release maintainers. |
/run-all-tests |
/run-all-tests |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
What problem does this PR solve?
Forbidden multiple statements to ease the security problem described here https://github.com/pingcap/tidb-test/issues/1152
This PR ports the code of #16056 to release-4.0, and also part of #17678 to clean up the code.
PS: To fix the point get DATA RACE in #18145, I try to avoid cherry-pick too many PRs and wrote:
Ironically, most of those refactoring PRs are cherry-picked to release-4.0 to get the "correct fix" in the end.
Problem Summary:
See https://github.com/pingcap/tidb-test/issues/1152
What is changed and how it works?
What's Changed:
Execute
is deprecated, useExecuteStmt
instead.How it Works:
The
Execute()
API can execute multiple statements from one query string, an attacker can leverage that to ingest arbitrarily SQL through this API.The
ExecuteStmt()
API allows only one statement, it's safer thanExecute()
.Check List
Tests
Side effects
API change, Execute is deprecated.
Release note