-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
planner: Fix Empty string has different meanings in SELECT and UPDATE #27954
base: master
Are you sure you want to change the base?
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. |
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.
Thanks for your contribution!
@yuqi1129: 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. |
seems has been fixed by #28229 |
@xiongjiwei , As you have commented, #28229 issue have introduced a new problem, maybe we should consider this two issue both and come up with a solution. |
@@ -986,7 +986,11 @@ func (b *PlanBuilder) buildSelection(ctx context.Context, p LogicalPlan, where a | |||
for _, item := range cnfItems { | |||
if con, ok := item.(*expression.Constant); ok && con.DeferredExpr == nil && con.ParamMarker == nil { | |||
ret, _, err := expression.EvalBool(b.ctx, expression.CNFExprs{con}, chunk.Row{}) |
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.
Seems the EvalBool
behavior is not the same with MySQL
mysql> /* s1 */ select * from t where ' ';
Empty set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: '' |
+---------+------+--------------------------------------+
1 row in set (0.01 sec)
mysql> /* s1 */ select * from t where ' ';
Empty set (0.00 sec)
The first one is the TiDB's. You can see that MySQL doesn't throw warning out.
This could be a problem if we use a strict SQL mode. MySQL would success and TiDB would fail
@yuqi1129 @xiongjiwei @winoros any update on this issue? |
What problem does this PR solve?
Issue Number: close #27648
Problem Summary:
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
Check List
Tests
Side effects
Documentation
Release note