-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
component/jsonseverity/minorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
1. Minimal reproduce step (Required)
CREATE TABLE t1(id INT PRIMARY KEY, d1 DATE, d2 DATETIME, t1 TIME, t2 TIMESTAMP, b1 BIT, b2 BINARY);
INSERT INTO t1 VALUES (1, '2024-06-14', '2024-06-14 09:37:00', '09:37:00', '2024-06-14 09:37:00', b'0', 0x41);
SELECT JSON_TYPE(d1),JSON_TYPE(d2),JSON_TYPE(t1),JSON_TYPE(t2),JSON_TYPE(b1),JSON_TYPE(b2) FROM t1;
2. What did you expect to see? (Required)
mysql-8.4.0> CREATE TABLE t1(id INT PRIMARY KEY, d1 DATE, d2 DATETIME, t1 TIME, t2 TIMESTAMP, b1 BIT, b2 BINARY);
Query OK, 0 rows affected (0.02 sec)
mysql-8.4.0> INSERT INTO t1 VALUES (1, '2024-06-14', '2024-06-14 09:37:00', '09:37:00', '2024-06-14 09:37:00', b'0', 0x41);
Query OK, 1 row affected (0.01 sec)
mysql-8.4.0> SELECT JSON_TYPE(d1),JSON_TYPE(d2),JSON_TYPE(t1),JSON_TYPE(t2),JSON_TYPE(b1),JSON_TYPE(b2) FROM t1;
ERROR 3146 (22032): Invalid data type for JSON data in argument 1 to function json_type; a JSON string or JSON type is required.
3. What did you see instead (Required)
mysql-8.0.11-TiDB-v8.1.0> CREATE TABLE t1(id INT PRIMARY KEY, d1 DATE, d2 DATETIME, t1 TIME, t2 TIMESTAMP, b1 BIT, b2 BINARY);
Query OK, 0 rows affected (0.11 sec)
mysql-8.0.11-TiDB-v8.1.0> INSERT INTO t1 VALUES (1, '2024-06-14', '2024-06-14 09:37:00', '09:37:00', '2024-06-14 09:37:00', b'0', 0x41);
Query OK, 1 row affected (0.01 sec)
mysql-8.0.11-TiDB-v8.1.0> SELECT JSON_TYPE(d1),JSON_TYPE(d2),JSON_TYPE(t1),JSON_TYPE(t2),JSON_TYPE(b1),JSON_TYPE(b2) FROM t1;
+---------------+---------------+---------------+---------------+------------------+---------------+
| JSON_TYPE(d1) | JSON_TYPE(d2) | JSON_TYPE(t1) | JSON_TYPE(t2) | JSON_TYPE(b1) | JSON_TYPE(b2) |
+---------------+---------------+---------------+---------------+------------------+---------------+
| DATE | DATETIME | TIME | DATETIME | UNSIGNED INTEGER | BLOB |
+---------------+---------------+---------------+---------------+------------------+---------------+
1 row in set (0.00 sec)
4. What is your TiDB version? (Required)
Release Version: v8.1.0
Edition: Community
Git Commit Hash: 945d07c5d5c7a1ae212f6013adfb187f2de24b23
Git Branch: HEAD
UTC Build Time: 2024-05-21 03:51:57
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Metadata
Metadata
Assignees
Labels
component/jsonseverity/minorsig/sql-infraSIG: SQL InfraSIG: SQL Infratype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.