Skip to content

expression: let PushDownNot does not change the argument - #10363

Merged
alivxxx merged 3 commits into
pingcap:masterfrom
alivxxx:pushNot
May 6, 2019
Merged

expression: let PushDownNot does not change the argument#10363
alivxxx merged 3 commits into
pingcap:masterfrom
alivxxx:pushNot

Conversation

@alivxxx

@alivxxx alivxxx commented May 6, 2019

Copy link
Copy Markdown
Contributor

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

alivxxx commented May 6, 2019

Copy link
Copy Markdown
Contributor Author

/run-all-tests

@winoros winoros left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

},
{
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes...

@codecov

codecov Bot commented May 6, 2019

Copy link
Copy Markdown

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
Comment thread expression/util.go Outdated

@XuHuaiyu XuHuaiyu left a comment

Copy link
Copy Markdown
Contributor

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