Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.11, 11.4, 11.8, 12.3, 13.1
-
None
-
Not for Release Notes
Description
Hi,
The following test case shows the incorrect data size in CREATE TABLE when using JSON_INSERT in a subquery
CREATE TABLE src(val LONGTEXT); |
INSERT INTO src VALUES(REPEAT('x',100)); |
|
|
CREATE TABLE t2 AS |
SELECT JSON_INSERT('{"k1":"v1"}', '$.k3', val) AS j |
FROM src |
LIMIT 0;
|
|
|
SHOW CREATE TABLE t2; |
-- t2 CREATE TABLE `t2` (
|
-- `j` varchar(36) DEFAULT NULL
|
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
-- This is incorrect as the size of j is only 36, 122 is expected
|
|
|
INSERT IGNORE INTO t2 |
SELECT JSON_INSERT('{"k1":"v1"}', '$.k3', val) AS j |
FROM src; |
-- Warning 1265 Data truncated for column 'j' at row 1 |
Attachments
Issue Links
- duplicates
-
MDEV-39953 Using JSON_SET in the VIEW creation truncates the JSON data
-
- Confirmed
-