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: add keepnull flag in FieldType and use by NewFunction #19639

Closed
wants to merge 5 commits into from

Conversation

wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Sep 1, 2020

What problem does this PR solve?

Issue Number: close #17720 #17476

Problem Summary: NewFunction can't get keepnull attributes for isture function.

What is changed and how it works?

Proposal: xxx

What's Changed:

  1. Add IsTureWithKeepNullFlag flag in FieldType flag.
  2. Set the flag in function wrapWithIsTrue.
  3. Use the flag in newFunctionImpl.

How it Works:

Related changes

  • Need to cherry-pick to the release branch 3.0, 4.0

Check List

Tests

  • Unit test
  • Integration test

Side effects

Release note

  • Fix the behavior of rewrite ScalarFunction IsTure .

@wshwsh12 wshwsh12 requested a review from a team as a code owner September 1, 2020 03:44
@wshwsh12 wshwsh12 requested review from XuHuaiyu and removed request for a team September 1, 2020 03:44
@@ -1218,5 +1218,8 @@ func wrapWithIsTrue(ctx sessionctx.Context, keepNull bool, arg Expression, wrapF
Function: f,
RetType: f.getRetTp(),
}
if keepNull {
f.getRetTp().Flag ^= mysql.IsTureWithKeepNullFlag
Copy link
Contributor

Choose a reason for hiding this comment

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

Ture --> True

@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Sep 1, 2020

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 1, 2020
@wshwsh12 wshwsh12 closed this Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression 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.

OR operation not correct in where clause
3 participants