-
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
*: refactor ExecuteInternal to return single resultset (#22546) #22640
*: refactor ExecuteInternal to return single resultset (#22546) #22640
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
@morgo please accept the invitation then you can push to the cherry-pick pull requests. |
Wow, so many conflicts... |
This depends on #22548 - I will wait for it to merge first. |
But that is blocked on merge. We may need to apply for cherry-picking. |
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
bindinfo/handle.go
Outdated
sctx.GetSessionVars().UsePlanBaselines = oriVals | ||
if len(recordSets) > 0 { | ||
defer terror.Log(recordSets[0].Close()) | ||
if rs != nil { |
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.
Same to the 5.0-rc, we can remove the check, and move the defer
after err != nil
check.
bindinfo/handle.go
Outdated
if err != nil { | ||
if len(recordSets) > 0 { | ||
terror.Call(recordSets[0].Close) | ||
if rs != nil { |
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.
ditto
session/bootstrap.go
Outdated
`SELECT bind_sql, default_db, status, create_time, charset, collation, source | ||
FROM mysql.bind_info | ||
WHERE source != 'builtin' | ||
ORDER BY update_time DESC`) | ||
if err != nil { | ||
logutil.BgLogger().Fatal("upgradeToVer61 error", zap.Error(err)) | ||
} | ||
if len(recordSets) > 0 { | ||
defer terror.Call(recordSets[0].Close) | ||
if rs != nil { |
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.
ditto
session/session.go
Outdated
}() | ||
if err != nil { | ||
rs, err := se.ExecuteInternal(ctx, sql) | ||
if rs != nil { |
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.
ditto
/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
/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 |
@xhebox: 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. |
/merge cancel |
Signed-off-by: xhe <[email protected]>
/merge |
@xhebox: 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: 56519e6
|
cherry-pick #22546 to release-4.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/22640
After apply modifications, you can push your change to this PR via:
What problem does this PR solve?
Problem Summary:
Both
Execute
andExecuteInternal
no longer permit multi-statement, but the return type was maintained the same for backward compatibility.This changes
ExecuteInternal
to return a single result-set.Update: I've removed
Execute
from this PR, we can handle it in followup PRs.What is changed and how it works?
What's Changed:
This changes the return type of
ExecuteInternal
to be a non-array value.All uses of(for future PRs - it does not need to be handled all at once).Execute
are changed to useExecuteInternal
Related changes
Check List
Tests
Side effects
Release note