[MDEV-22293] JSON_TABLE: Values for regular columns are truncated for no reason Created: 2020-04-18  Updated: 2020-04-27  Resolved: 2020-04-27

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: N/A
Fix Version/s: N/A

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

Issue Links:
Relates
relates to MDEV-17399 Add support for JSON_TABLE Closed
relates to MDEV-22298 JSON_TABLE: EXISTS PATH value is conv... Closed

 Description   

The column is of sufficient length, there should be no truncation.

bb-10.5-hf 6dfb3fab2

+------+
| a    |
+------+
| fo   |
+------+
1 row in set (0.002 sec)

MySQL 8.0.19

MySQL [test]> select * from json_table('{"a":"foo"}',"$" columns(a varchar(8) path '$.a')) x;
+------+
| a    |
+------+
| foo  |
+------+
1 row in set (0.001 sec)

It works in MariaDB, too, with slightly longer column:

MariaDB [test]> select * from json_table('{"a":"foo"}',"$" columns(a varchar(12) path '$.a')) x;
+------+
| a    |
+------+
| foo  |
+------+
1 row in set (0.002 sec)

set names doesn't seem to change the outcome, tried latin1, utf8, utf8mb4.


Generated at Thu Feb 08 09:13:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.