*: refactor ExecuteInternal to return single resultset (#22546)#22640
*: refactor ExecuteInternal to return single resultset (#22546)#22640ti-chi-bot merged 8 commits intopingcap:release-4.0from
Conversation
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
|
/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. |
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.
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 { |
session/bootstrap.go
Outdated
| } | ||
| if len(recordSets) > 0 { | ||
| defer terror.Call(recordSets[0].Close) | ||
| if rs != nil { |
session/session.go
Outdated
| }() | ||
| if err != nil { | ||
| rs, err := se.ExecuteInternal(ctx, sql) | ||
| if rs != nil { |
|
/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. DetailsReviewer 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. DetailsInstructions 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 <xw897002528@gmail.com>
|
/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. DetailsInstructions 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. DetailsCommit 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/22640After apply modifications, you can push your change to this PR via:
What problem does this PR solve?
Problem Summary:
Both
ExecuteandExecuteInternalno longer permit multi-statement, but the return type was maintained the same for backward compatibility.This changes
ExecuteInternalto return a single result-set.Update: I've removed
Executefrom 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
ExecuteInternalto be a non-array value.All uses of(for future PRs - it does not need to be handled all at once).Executeare changed to useExecuteInternalRelated changes
Check List
Tests
Side effects
Release note