[MDEV-11436] CREATE TABLE .. AS SELECT JSON_OBJECT truncates data Created: 2016-12-01  Updated: 2016-12-04  Resolved: 2016-12-04

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2
Fix Version/s: 10.2.3

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: json-10.2

Issue Links:
Relates
relates to MDEV-9143 JSON_xxx functions Closed

 Description   

MariaDB [test]> CREATE TABLE t AS SELECT JSON_OBJECT('id', 87, 'name', 'carrot') AS f;
Query OK, 1 row affected, 1 warning (0.48 sec)
Records: 1  Duplicates: 0  Warnings: 1
 
MariaDB [test]> SHOW WARNINGS;
+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1265 | Data truncated for column 'f' at row 1 |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)

MariaDB [test]> SHOW CREATE TABLE t\G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `f` varchar(26) CHARACTER SET utf8 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
 
MariaDB [test]> SELECT * FROM t;
+----------------------------+
| f                          |
+----------------------------+
| {"id": 87, "name": "carrot |
+----------------------------+
1 row in set (0.00 sec)



 Comments   
Comment by Alexey Botchkov [ 2016-12-04 ]

http://lists.askmonty.org/pipermail/commits/2016-December/010183.html

Generated at Thu Feb 08 07:49:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.