-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
types: fix unexpected NOT_NULL flags #19029
Conversation
Does this also fix #18488 by chance? |
Yes, the previous implementation adds |
/run-all-tests |
/rebuild |
/run-common-test |
/run-check_dev_2 |
Codecov Report
@@ Coverage Diff @@
## master #19029 +/- ##
================================================
- Coverage 79.3297% 79.2528% -0.0770%
================================================
Files 546 546
Lines 148663 148314 -349
================================================
- Hits 117934 117543 -391
- Misses 21234 21274 +40
- Partials 9495 9497 +2 |
@qw4990, @XuHuaiyu, @wjhuang2016, @lzmhhh123, PTAL. |
1 similar comment
@qw4990, @XuHuaiyu, @wjhuang2016, @lzmhhh123, PTAL. |
expression/constant.go
Outdated
func (c *Constant) Clone() Expression { | ||
con := &Constant{ | ||
Value: c.Value, | ||
once: sync.Once{}, |
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.
Once not clone?
@@ -110,6 +121,12 @@ func (c *Constant) GetType() *types.FieldType { | |||
types.DefaultParamTypeForValue(dt.GetValue(), tp) | |||
return tp | |||
} | |||
if !c.Value.IsNull() { |
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.
We can check !c.Value.IsNull() && c.RetType.Flag&mysql.NotNullFlag == 0
.
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.
Then we can remove the sync.Once
.
273674a
to
362c928
Compare
/run-all-tests |
@lzmhhh123, @qw4990, @wjhuang2016, PTAL. |
@lzmhhh123, @blacktear23, @qw4990, @wjhuang2016, PTAL. |
1 similar comment
@lzmhhh123, @blacktear23, @qw4990, @wjhuang2016, PTAL. |
@qw4990, @wjhuang2016, PTAL. |
#21307 can also be fixed by the pr. |
1 similar comment
#21307 can also be fixed by the pr. |
@SunRunAway: PR needs rebase. 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 kubernetes/test-infra repository. |
@lzmhhh123, @blacktear23, @qw4990, @wjhuang2016, PTAL. |
2 similar comments
@lzmhhh123, @blacktear23, @qw4990, @wjhuang2016, PTAL. |
@lzmhhh123, @blacktear23, @qw4990, @wjhuang2016, PTAL. |
I'm trying to let |
What problem does this PR solve?
Issue Number:
related to #18921, and close #19025, close #18488
Problem Summary:
It is introduced from #9689
What is changed and how it works?
Proposal: xxx
What's Changed:
select constants
is not same with MySQL. #9463How it Works:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note