-
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
ddl: migrate part of ddl package code from Execute/ExecRestricted to safe API (1) (#22670) #22930
ddl: migrate part of ddl package code from Execute/ExecRestricted to safe API (1) (#22670) #22930
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
@AilinKid you're already a collaborator in bot's repo. |
Signed-off-by: ailinkid <[email protected]>
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.
Rest LGTM.
BTW, update the PR in the document.
ddl/util/util.go
Outdated
// LoadGlobalVars loads global variable from mysql.global_variables. | ||
func LoadGlobalVars(ctx sessionctx.Context, varNames []string) error { | ||
if sctx, ok := ctx.(sqlexec.RestrictedSQLExecutor); ok { | ||
nameList := "" | ||
var buf strings.Builder | ||
sqlexec.MustFormatSQL(&buf, loadGlobalVars) | ||
for i, name := range varNames { |
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.
You can use %?
to output 'xx','xx'
for []string
type.
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.
addressed PTAL @xhebox
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.
Then these two invocation of MustFormatSQL
can be combined into one.
Signed-off-by: ailinkid <[email protected]>
Signed-off-by: ailinkid <[email protected]>
/lgtm |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
@AilinKid: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 10737b5
|
cherry-pick #22670 to release-3.0
You can switch your code base to this Pull Request by using git-extras:
# In tidb repo: git pr https://github.com/pingcap/tidb/pull/22930
After apply modifications, you can push your change to this PR via:
Signed-off-by: AilinKid [email protected]
What problem does this PR solve?
Issue Number: part close #pingcap/tidb-test#1152
What is changed and how it works?
What's Changed:
Migrate part of code in ddl package from using Execute/ExecRestricted to safe API
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Release note