-
Notifications
You must be signed in to change notification settings - Fork 6k
Open
Labels
component/expressionseverity/moderatesig/executionSIG executionSIG executiontype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; CREATE TABLE t15 (a INT SIGNED, b INT UNSIGNED); INSERT INTO t15 VALUES (10, 20); SELECT * FROM t15 WHERE a - b < 0; DROP TABLE t15; SET SQL_MODE=default;
2. What did you expect to see? (Required)
mysql> SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; CREATE TABLE t15 (a INT SIGNED, b INT UNSIGNED); INSERT INTO t15 VALUES (10, 20); SELECT * FROM t15 WHERE a - b < 0; DROP TABLE t15; SET SQL_MODE=default;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.06 sec)
Query OK, 1 row affected (0.01 sec)
+------+------+
| a | b |
+------+------+
| 10 | 20 |
+------+------+
1 row in set (0.00 sec)
Query OK, 0 rows affected (0.02 sec)
Query OK, 0 rows affected (0.00 sec)
3. What did you see instead (Required)
mysql> SET SQL_MODE='NO_UNSIGNED_SUBTRACTION'; CREATE TABLE t15 (a INT SIGNED, b INT UNSIGNED); INSERT INTO t15 VALUES (10, 20); SELECT * FROM t15 WHERE a - b < 0; DROP TABLE t15; SET SQL_MODE=default;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.06 sec)
Query OK, 1 row affected (0.01 sec)
ERROR 1690 (22003): BIGINT value is out of range in '(10 - 20)'
Query OK, 0 rows affected (0.07 sec)
Query OK, 0 rows affected (0.00 sec)
4. What is your TiDB version? (Required)
Metadata
Metadata
Assignees
Labels
component/expressionseverity/moderatesig/executionSIG executionSIG executiontype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.