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
*: fix some problems related to notNullFlag #27697
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
27a1bba
to
2ce4969
Compare
2ce4969
to
7b32550
Compare
@@ -76,9 +76,6 @@ func dumpFlag(tp byte, flag uint16) uint16 { | |||
case mysql.TypeEnum: | |||
return flag | uint16(mysql.EnumFlag) | |||
default: | |||
if mysql.HasBinaryFlag(uint(flag)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's unreasonable.
expression/constant.go
Outdated
@@ -71,6 +71,19 @@ type Constant struct { | |||
collationInfo | |||
} | |||
|
|||
// Clone implements Expression interface. | |||
func (c *Constant) Clone() Expression { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #19029, I think it's the right way for Clone. We should clone the retType too. Though it's not necessary for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this modification is not necessary for this PR, I think we can remove it.
expression/simple_rewriter.go
Outdated
@@ -58,7 +58,7 @@ func ParseSimpleExprCastWithTableInfo(ctx sessionctx.Context, exprStr string, ta | |||
if err != nil { | |||
return nil, err | |||
} | |||
e = BuildCastFunction(ctx, e, targetFt) | |||
e = BuildCastFunction(ctx, e, targetFt.Clone()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #19029, I think it's reasonable not to let column and scalarFunction share the same ft. Though it's not necessary for this PR.
f6cbe48
to
05f624c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 05f624c
|
@wjhuang2016: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #19025, close #18488
Problem Summary:
This PR is based on #19029. It fixes some problems related to the notNullFlag.
What is changed and how it works?
Remove adding NotNullFlag in dumpFlag.
Add NotNullFlag for Null constant in DefaultTypeForValue.
Check List
Tests
Side effects
Documentation
Release note