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

expression: let PushDownNot does not change the argument #10363

Merged
merged 3 commits into from
May 6, 2019

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented May 6, 2019

What problem does this PR solve?

Fix #10344

What is changed and how it works?

PushDownNot directly change its argument expr, and if the expr is referenced in other places, it will cause wrong results. This PR keeps the argument unchanged.

Check List

Tests

  • Unit test
  • Integration test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

@alivxxx
Copy link
Contributor Author

alivxxx commented May 6, 2019

/run-all-tests

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

@@ -395,7 +395,7 @@ func (s *testPlanSuite) TestSimplifyOuterJoin(c *C) {
},
{
sql: "select * from t t1 left join t t2 on t1.b = t2.b where not (t1.c > 1 and t2.c > 1);",
best: "Join{DataScan(t1)->DataScan(t2)}(test.t1.b,test.t2.b)->Sel([not(and(le(test.t1.c, 1), le(test.t2.c, 1)))])->Projection",
Copy link
Member

Choose a reason for hiding this comment

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

So this one is wrong previously? 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes...

@codecov
Copy link

codecov bot commented May 6, 2019

Codecov Report

Merging #10363 into master will increase coverage by 0.0169%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #10363        +/-   ##
================================================
+ Coverage   77.6648%   77.6818%   +0.0169%     
================================================
  Files           411        411                
  Lines         85475      85437        -38     
================================================
- Hits          66384      66369        -15     
+ Misses        14128      14114        -14     
+ Partials       4963       4954         -9

@alivxxx alivxxx added status/all tests passed status/LGT1 Indicates that a PR has LGTM 1. labels May 6, 2019
expression/util.go Outdated Show resolved Hide resolved
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

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression 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.

In transaction select result is incorrect.
3 participants