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: correct block offset for table as names #12996

Merged
merged 8 commits into from
Nov 11, 2019

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Oct 29, 2019

What problem does this PR solve?

Hint in select /*+ SM_JOIN(@sel_1 t1@sel_1, t2@sel_1) */ * from (select * from t) t1, t t2 where t1.b = t2.b; does not take effects.
It does not take effects because currently planner thinks t1 belongs to sel_2, so it cannot find a matching table.

What is changed and how it works?

Specially handle the case of select block as names so that the as names should belong to its surrounding select block, not the sub-query.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • None

Release note

  • None

@alivxxx alivxxx added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels Oct 29, 2019
@codecov
Copy link

codecov bot commented Oct 29, 2019

Codecov Report

Merging #12996 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master    #12996   +/-   ##
=========================================
  Coverage   80.633%   80.633%           
=========================================
  Files          469       469           
  Lines       113931    113931           
=========================================
  Hits         91866     91866           
  Misses       15077     15077           
  Partials      6988      6988

Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't take effect should be correct behavior since we don't consider subquery concurrently?

@alivxxx
Copy link
Contributor Author

alivxxx commented Nov 7, 2019

@winoros In this case, I think we can support it and it matches what we think it should do.

@alivxxx alivxxx requested review from winoros and lzmhhh123 November 7, 2019 05:58
Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lzmhhh123 lzmhhh123 added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 11, 2019
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@alivxxx alivxxx added the status/can-merge Indicates a PR has been approved by a committer. label Nov 11, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 11, 2019

Your auto merge job has been accepted, waiting for 13360

@alivxxx alivxxx added status/LGT2 Indicates that a PR has LGTM 2. needs-cherry-pick-3.1 and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 11, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 11, 2019

/run-all-tests

@sre-bot sre-bot merged commit f4ee90d into pingcap:master Nov 11, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Nov 11, 2019

cherry pick to release-3.1 failed

@alivxxx alivxxx deleted the block-offset branch November 11, 2019 11:15
@alivxxx alivxxx restored the block-offset branch November 11, 2019 11:27
@alivxxx alivxxx deleted the block-offset branch November 11, 2019 11:27
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants