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, executor: eliminate extra columns introduced by OrderBy upon Union #8290

Merged
merged 5 commits into from
Nov 13, 2018

Conversation

AndrewDi
Copy link
Contributor

@AndrewDi AndrewDi commented Nov 13, 2018

What problem does this PR solve?

fix issue #8189 and issue #8199

What is changed and how it works?

When a SELECT statement contains UNION and ORDER BY cause contains select statement,TiDB will generate extra columns, so I add LogicalProjection when building union LogicalPlan to eliminate generated extra columns.

Check List

Tests

  • Unit test

Code changes

Side effects

Related changes

@sre-bot
Copy link
Contributor

sre-bot commented Nov 13, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@ngaut
Copy link
Member

ngaut commented Nov 13, 2018

/run-all-tests

@XuHuaiyu XuHuaiyu changed the title fix issue #8189 and issue #8199 planner, executor: eliminate extra columns introduced by OrderBy upon Union Nov 13, 2018
@XuHuaiyu XuHuaiyu requested review from XuHuaiyu and removed request for XuHuaiyu November 13, 2018 06:25
@zz-jason zz-jason added contribution This PR is from a community contributor. sig/planner SIG: Planner labels Nov 13, 2018
@AndrewDi
Copy link
Contributor Author

/run-all-tests

planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
planner/core/logical_plan_builder.go Outdated Show resolved Hide resolved
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.

Thanks for contributing. please add a unit test in planner/core package for keeping test's coverage.
main changes LGTM

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

@winoros winoros added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 13, 2018
@winoros winoros added the type/bugfix This PR fixes a bug. label Nov 13, 2018
@XuHuaiyu
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@winoros winoros merged commit aa97970 into pingcap:master Nov 13, 2018
@AndrewDi AndrewDi deleted the fix_union_orderby branch November 13, 2018 11:30
@XuHuaiyu
Copy link
Contributor

@AndrewDi It seems that we should cherry-pick this to release-2.1 and release-2.0?

AndrewDi added a commit to AndrewDi/tidb that referenced this pull request Nov 14, 2018
AndrewDi added a commit to AndrewDi/tidb that referenced this pull request Nov 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. sig/planner SIG: Planner status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants