TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
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.
Bug Report
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
MySQL:
3. What did you see instead (Required)
TiDB:
4. What is your TiDB version? (Required)
Related
This is similar to #44213 but for a different set of types.
This is related to https://github.com/pingcap/tidb/issues/44786