Skip to content
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

Unnecessary warning on NULL computation. #31478

Open
where2me opened this issue Jan 8, 2022 · 0 comments
Open

Unnecessary warning on NULL computation. #31478

where2me opened this issue Jan 8, 2022 · 0 comments
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@where2me
Copy link

where2me commented Jan 8, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 NUMERIC);
INSERT INTO t0 VALUES(1);
SELECT c0 FROM t0 WHERE NULL^(1 AND 'a');
SHOW WARNINGS;

2. What did you expect to see? (Required)

There should be no warning displayed, because NULL computes on ^ is always NULL.
Moreover, I want to know why the expression 'a' is treated as a DOUBLE value, not an INTEGER.

3. What did you see instead (Required)

mysql> SHOW WARNINGS;
+---------+------+---------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'a' |
+---------+------+---------------------------------------+
1 row in set (0.00 sec)

4. What is your TiDB version? (Required)

mysql> SELECT tidb_version() ;
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()

                               |

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.3.0
Edition: Community
Git Commit Hash: 4a1b2e9
Git Branch: heads/refs/tags/v5.3.0
UTC Build Time: 2021-11-24 13:32:39
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

@where2me where2me added the type/bug The issue is confirmed as a bug. label Jan 8, 2022
@djshow832 djshow832 added the sig/execution SIG execution label Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants