server,session: code refactor for multiple statements in one query #16056#22451
Merged
ti-srebot merged 7 commits intopingcap:release-4.0from Jan 26, 2021
Merged
server,session: code refactor for multiple statements in one query #16056#22451ti-srebot merged 7 commits intopingcap:release-4.0from
ti-srebot merged 7 commits intopingcap:release-4.0from
Conversation
Contributor
|
LGTM |
Contributor
Contributor
Author
Contributor
|
LGTM |
ti-srebot
previously approved these changes
Jan 25, 2021
Contributor
|
/merge |
Contributor
|
Sorry @xhebox, this branch cannot be merged without an approval of release maintainers. |
Contributor
Author
|
/merge |
Contributor
|
Sorry @tiancaiamao, this branch cannot be merged without an approval of release maintainers. |
AilinKid
previously approved these changes
Jan 25, 2021
Contributor
|
/merge |
Contributor
|
Sorry @AilinKid, this branch cannot be merged without an approval of release maintainers. |
Contributor
Contributor
Author
|
/run-all-tests |
Contributor
Author
|
/run-all-tests |
bb7133
approved these changes
Jan 26, 2021
ti-srebot
approved these changes
Jan 26, 2021
Member
|
/merge |
Contributor
|
Your auto merge job has been accepted, waiting for:
|
Contributor
|
/run-all-tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Executeis deprecated, useExecuteStmtinstead.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