-
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
IN clause on a non-integer column with NULL value would cause unexpected warning or error #49015
Comments
It's not necessary to include 2 value pairs in the IN clause /* t2 */ explain select * from test.t where (a, b) in ((null, 0));
-- t2 >> +---------------------+----------+-----------+---------------+----------------------------------------------------------+
-- t2 | id | estRows | task | access object | operator info |
-- t2 +---------------------+----------+-----------+---------------+----------------------------------------------------------+
-- t2 | TableReader_7 | 8.00 | root | | data:Selection_6 |
-- t2 | └─Selection_6 | 8.00 | cop[tikv] | | eq(cast(test.t.a, double BINARY), NULL), eq(test.t.b, 0) |
-- t2 | └─TableFullScan_5 | 10000.00 | cop[tikv] | table:t | keep order:false, stats:pseudo |
-- t2 +---------------------+----------+-----------+---------------+----------------------------------------------------------+
/* t2 */ select * from test.t where (a, b) in ((null, 0));
-- t2 >> +---+---+
-- t2 | a | b |
-- t2 +---+---+
-- t2 +---+---+
/* t2 */ show warnings;
-- t2 >> +---------+------+-------------------------------------------------------------+
-- t2 | Level | Code | Message |
-- t2 +---------+------+-------------------------------------------------------------+
-- t2 | Warning | 1292 | evaluation failed: Truncated incorrect INTEGER value: 'abc' |
-- t2 +---------+------+-------------------------------------------------------------+ |
Reproduced the issue(both warning and error) in v5.1.0, seems an existing bug from very beginning. |
Confirmed that the issue is introduced by #14571, and takes effect in this issue by following steps:
|
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
The statements above should be executed successfully with correct result.
3. What did you see instead (Required)
As pasted above, the select statement reports a warning, and the update statement failed with an error.
4. What is your TiDB version? (Required)
Master.
The text was updated successfully, but these errors were encountered: