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

reslove the correlated agg func's correlated col when it in the sub-query #11

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

AilinKid
Copy link
Collaborator

@AilinKid AilinKid commented Mar 15, 2022

Signed-off-by: ailinkid 314806019@qq.com

What problem does this PR solve?

fix pingcap#30024: reslove the correlated agg func's correlated col when it in the sub-query

Reason: kind of name resolver problem, the agg inside sub-query is actually correlated with the outside group, so does the col name inside the agg func. this two expr should be built/kept in the outer schema, otherwise, when we are building having clause, the sub-query couldn't find the reference anywhere.

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has exported function/method change
  • Has exported variable/fields change
  • Has interface methods change
  • Has persistent data change

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation
  • Need to update the tidb-ansible repository
  • Need to be included in the release note

…uery

Signed-off-by: ailinkid <314806019@qq.com>
@winoros winoros merged commit 89b7b99 into winoros:functional-dependency Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants