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: ByItem should filter NULL out #10488

Merged
merged 3 commits into from
May 22, 2019

Conversation

winoros
Copy link
Member

@winoros winoros commented May 15, 2019

What problem does this PR solve?

partially fix #10478
and fix #10456

What is changed and how it works?

filter NULL value in planner phase.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch (part of codes)

@winoros winoros added type/bugfix This PR fixes a bug. sig/planner SIG: Planner labels May 15, 2019
@codecov
Copy link

codecov bot commented May 15, 2019

Codecov Report

Merging #10488 into master will decrease coverage by 0.0042%.
The diff coverage is 85.3658%.

@@               Coverage Diff                @@
##             master     #10488        +/-   ##
================================================
- Coverage   77.3317%   77.3274%   -0.0043%     
================================================
  Files           413        413                
  Lines         87316      87273        -43     
================================================
- Hits          67523      67486        -37     
+ Misses        14604      14597         -7     
- Partials       5189       5190         +1

Copy link
Contributor

@alivxxx alivxxx 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/LGT1 Indicates that a PR has LGTM 1. label May 16, 2019
@@ -201,6 +202,14 @@ func (s *testPlanSuite) TestDAGPlanBuilderSimpleCase(c *C) {
sql: "select * from ((SELECT 1 a,6 b) UNION (SELECT 2,5) UNION (SELECT 2, 4) ORDER BY 1) t order by 1, 2",
best: "UnionAll{Dual->Projection->Dual->Projection->Dual->Projection}->HashAgg->Sort->Sort",
},
{
sql: "select * from (select *, NULL as xxx from t) t order by xxx",
Copy link
Contributor

Choose a reason for hiding this comment

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

This test can work well without this commit.
Maybe we need to build another case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me check it later.

@winoros winoros requested a review from eurekaka May 21, 2019 15:22
eurekaka
eurekaka previously approved these changes May 22, 2019
Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 22, 2019
@eurekaka
Copy link
Contributor

@winoros please resolve conflicts.

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason merged commit 81167c7 into pingcap:master May 22, 2019
db-storage pushed a commit to db-storage/tidb that referenced this pull request May 29, 2019
winoros added a commit to winoros/tidb that referenced this pull request Jun 5, 2019
zz-jason pushed a commit that referenced this pull request Jun 5, 2019
@winoros winoros deleted the by-items-filter-out-null branch June 26, 2019 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner 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.

TiDB doesn't handle sort by NULL correctly Window function panicked when partition by NULL
5 participants