Skip to content
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

planner: fix the incorrect judgment of correlated column in the having clause #51849

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Mar 18, 2024

What problem does this PR solve?

Issue Number: close #51107

Problem Summary:

What changed and how does it work?

the fields in the having clause should be a correlated column unrelated to select fields and group-by fields.

Check List

Tests

  • Unit test
  • 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.

修复在 having 语句中无法识别相关列,这可能导致错误的结果
Fix the inability to recognize related columns in the HAVING clause, which may lead to incorrect results.

@hawkingrei hawkingrei marked this pull request as draft March 18, 2024 05:57
@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/needs-triage-completed and removed do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked labels Mar 18, 2024
@hawkingrei hawkingrei marked this pull request as ready for review March 20, 2024 09:06
@ti-chi-bot ti-chi-bot bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-triage-completed labels Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Merging #51849 (8fc1084) into master (3f915c0) will decrease coverage by 15.8546%.
Report is 33 commits behind head on master.
The diff coverage is 87.5000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51849         +/-   ##
=================================================
- Coverage   70.6755%   54.8210%   -15.8546%     
=================================================
  Files          1476       1588        +112     
  Lines        438355     613394     +175039     
=================================================
+ Hits         309810     336269      +26459     
- Misses       109084     253793     +144709     
- Partials      19461      23332       +3871     
Flag Coverage Δ
integration 36.7085% <50.0000%> (?)
unit 70.5012% <87.5000%> (+0.0229%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 51.0582% <ø> (+5.1926%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 20, 2024
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei hawkingrei changed the title *: fix query gets a unstable result using subquery planner: fix the incorrect judgment of columns related to the having clause Mar 20, 2024
@hawkingrei hawkingrei changed the title planner: fix the incorrect judgment of columns related to the having clause planner: fix the incorrect judgment of correlated column in the having clause Mar 20, 2024
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
@hawkingrei
Copy link
Member Author

/retest

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 21, 2024
Copy link

ti-chi-bot bot commented Mar 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AilinKid, winoros

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 21, 2024
Copy link

ti-chi-bot bot commented Mar 21, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-21 04:27:31.361194643 +0000 UTC m=+1523678.383441026: ☑️ agreed by winoros.
  • 2024-03-21 04:57:44.139459794 +0000 UTC m=+1525491.161706174: ☑️ agreed by AilinKid.

@ti-chi-bot ti-chi-bot bot merged commit 73328e5 into pingcap:master Mar 21, 2024
23 checks passed
@hawkingrei
Copy link
Member Author

/cherrypick release-8.0
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.5

@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-6.5: #51973.

In response to this:

/cherrypick release-8.0
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.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.

@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.1: #51974.

In response to this:

/cherrypick release-8.0
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.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.

@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-7.5: #51975.

In response to this:

/cherrypick release-8.0
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.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.

@ti-chi-bot
Copy link
Member

@hawkingrei: new pull request created to branch release-8.0: #51976.

In response to this:

/cherrypick release-8.0
/cherrypick release-7.5
/cherrypick release-7.1
/cherrypick release-6.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.

ti-chi-bot bot pushed a commit that referenced this pull request Mar 21, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Mar 21, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Mar 26, 2024
@hawkingrei hawkingrei deleted the 51107 branch April 15, 2024 03:31
ti-chi-bot bot pushed a commit that referenced this pull request Apr 17, 2024
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 22, 2024
@elsa0520
Copy link
Contributor

elsa0520 commented May 8, 2024

/cherry-pick release-6.5-20230625-v6.5.3

@ti-chi-bot
Copy link
Member

@elsa0520: new pull request created to branch release-6.5-20230625-v6.5.3: #53098.

In response to this:

/cherry-pick release-6.5-20230625-v6.5.3

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query gets a unstable result using subquery
5 participants