-
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
compare NULL in int column with float got incorrect #16788
Comments
I found it has similar error when null on a int column comparing with a string: create table t0 (id int not null primary key auto_increment, c0 int);
insert into t0 values(null, 1),(null, null);
select * from t0 where c0 is null;
+----+------+
| id | c0 |
+----+------+
| 2 | NULL |
+----+------+
select * from t0 where (c0 >= "68903428378947589475") is null;
Empty set (0.00 sec) |
/pick-up |
Pick up success. |
The cause of this issue is that the when doing a comparison between a column and a constant value with a type different from the column type, the comparison is getting short-circuited by refineArgs.
There are two possible ways to fix this issue:
Either way changes the way SQL statements are evaluated. |
@youwithouto You did not submit PR within 7 days, so give up automatically. |
/pick-up |
Pick up success. |
@youwithouto You did not submit PR within 7 days, so give up automatically. |
/assign |
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)SIG slack channel
#sig-exec
Score
Mentor
The text was updated successfully, but these errors were encountered: