planner: merge FullSchema and FullNames of subplans when rewriting "in (subquery)" to inner join
What problem does this PR solve?
Issue Number: close #53766
Problem Summary:
What changed and how does it work?
Merge FullSchema and FullNames of subplans when rewring "in (subquery)" to inner join, which will be used to rewrite fields when using natural join. https://github.com/pingcap/tidb/blob/438169989e2d6ab5f778238d02eb50c8eb408a76/pkg/planner/core/expression_rewriter.go#L2469-L2485 The merging code I referenced was from the code in buildJoin as follows:
https://github.com/pingcap/tidb/blob/438169989e2d6ab5f778238d02eb50c8eb408a76/pkg/planner/core/logical_plan_builder.go#L985-L1026
Check List
Tests
- [ ] Unit test
- [x] Integration test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test
- [ ] I checked and no code files have been changed.
Side effects
- [ ] Performance regression: Consumes more CPU
- [ ] Performance regression: Consumes more Memory
- [ ] Breaking backward compatibility
Documentation
- [ ] Affects user behaviors
- [ ] Contains syntax changes
- [ ] Contains variable changes
- [ ] Contains experimental features
- [ ] Changes MySQL compatibility
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
None
Welcome @dash12653!
It looks like this is your first PR to pingcap/tidb 🎉.
I'm the bot to help you request reviewers, add labels and more, See available commands.
We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to pingcap/tidb. :smiley:
Hi @dash12653. Thanks for your PR.
I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test label.
I understand the commands that are listed here.
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 kubernetes/test-infra repository.
Hi @dash12653. Thanks for your PR.
PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.
I understand the commands that are listed here.
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 kubernetes-sigs/prow repository.
/ok-to-test
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 77.0460%. Comparing base (
b520f61) to head (9dddc81). Report is 832 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #54334 +/- ##
================================================
+ Coverage 73.3867% 77.0460% +3.6593%
================================================
Files 1620 1626 +6
Lines 447041 464984 +17943
================================================
+ Hits 328069 358252 +30183
+ Misses 98877 86453 -12424
- Partials 20095 20279 +184
| Flag | Coverage Δ | |
|---|---|---|
| integration | 51.3031% <100.0000%> (?) |
|
| unit | 74.3418% <100.0000%> (+1.8635%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Δ | |
|---|---|---|
| dumpling | 52.9478% <ø> (ø) |
|
| parser | ∅ <ø> (∅) |
|
| br | 53.6562% <76.9230%> (+8.1269%) |
:arrow_up: |
@dash12653 Hi, you need to also update the test result. Follow the below step:
- Use
maketo create binary. - Go to
tests/integrationtest - run
./run-tests.sh -s ../../bin/tidb-server -r planner/core/issuetest/planner_issueto re-generate the fileplanner_issue.result
@dash12653 Hi, you need to also update the test result. Follow the below step:
- Use
maketo create binary.- Go to
tests/integrationtest- run
./run-tests.sh -s ../../bin/tidb-server -r planner/core/issuetest/planner_issueto re-generate the fileplanner_issue.result
Hi winoros, Thank you very much for your comment, I have generated a new result file now, but it seems that I accidentally closed this PR. Do you know how to reopen this PR, or do I need to create a new PR?
@dash12653 Hi, you need to also update the test result. Follow the below step:
- Use
maketo create binary.- Go to
tests/integrationtest- run
./run-tests.sh -s ../../bin/tidb-server -r planner/core/issuetest/planner_issueto re-generate the fileplanner_issue.resultHi winoros, Thank you very much for your comment, I have generated a new result file now, but it seems that I accidentally closed this PR. Do you know how to reopen this PR, or do I need to create a new PR?
It has been reopened.
Thanks! I'll check whether the tests all are green and help to merge this pull request.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: hawkingrei, winoros
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [hawkingrei,winoros]
- ~~pkg/planner/OWNERS~~ [hawkingrei,winoros]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
[LGTM Timeline notifier]
Timeline:
2024-09-27 15:05:36.944048396 +0000 UTC m=+21692.364261408: :ballot_box_with_check: agreed by winoros.2024-10-10 06:14:01.875649957 +0000 UTC m=+1112997.295862969: :ballot_box_with_check: agreed by hawkingrei.
/retest
@AilinKid: You cannot manually add or delete the reviewing state labels, only I and the tursted members have permission to do so.
In response to removing label named approved.
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.
In response to a cherrypick label: new pull request created to branch release-7.1: #57036.
/cherrypick release-7.5
@hawkingrei: new pull request created to branch release-7.5: #58089.
In response to this:
/cherrypick release-7.5
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.
In response to a cherrypick label: new pull request created to branch release-6.5: #59176.