-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)This is a compatibility issue with MySQL 8.0(but NOT 5.7)severity/moderatetype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.type/compatibility
Description
Bug Report
1. Minimal reproduce step (Required)
DROP TABLE IF EXISTS test.t;
CREATE TABLE test.t (id bigint(11) UNSIGNED PRIMARY KEY);
INSERT INTO test.t VALUES (1234567890123456);
SELECT IFNULL(id, 'abcdef') FROM test.t;
2. What did you expect to see? (Required)
MySQL:
mysql-9.0.1> DROP TABLE IF EXISTS test.t;
Query OK, 0 rows affected (0.02 sec)
mysql-9.0.1> CREATE TABLE test.t (id bigint(11) UNSIGNED PRIMARY KEY);
Query OK, 0 rows affected, 1 warning (0.02 sec)
mysql-9.0.1> INSERT INTO test.t VALUES (1234567890123456);
Query OK, 1 row affected (0.00 sec)
mysql-9.0.1> SELECT IFNULL(id, 'abcdef') FROM test.t;
+----------------------+
| IFNULL(id, 'abcdef') |
+----------------------+
| 1234567890123456 |
+----------------------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
TiDB:
mysql-8.0.11-TiDB-v8.3.0> DROP TABLE IF EXISTS test.t;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql-8.0.11-TiDB-v8.3.0> CREATE TABLE test.t (id bigint(11) UNSIGNED PRIMARY KEY);
Query OK, 0 rows affected (0.05 sec)
mysql-8.0.11-TiDB-v8.3.0> INSERT INTO test.t VALUES (1234567890123456);
Query OK, 1 row affected (0.00 sec)
mysql-8.0.11-TiDB-v8.3.0> SELECT IFNULL(id, 'abcdef') FROM test.t;
+----------------------+
| IFNULL(id, 'abcdef') |
+----------------------+
| 12345678901 |
+----------------------+
1 row in set, 1 warning (0.00 sec)
mysql-8.0.11-TiDB-v8.3.0> SHOW WARNINGS;
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1406 | Data Too Long, field len 11, data len 16 |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
- v8.3.0
- v7.5.1
Related
This is similar to #44213 but for a different set of types.
This is related to #44786
Metadata
Metadata
Assignees
Labels
compatibility-mysql80This is a compatibility issue with MySQL 8.0(but NOT 5.7)This is a compatibility issue with MySQL 8.0(but NOT 5.7)severity/moderatetype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.type/compatibility