[MDEV-27362] JSON_OBJECT('name',zerofill_numeric_column) returns an invalid JSON Created: 2021-12-25  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None


 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT ZEROFILL);
INSERT INTO t1 VALUES (1);
SELECT JSON_OBJECT('a',a), JSON_VALID(JSON_OBJECT('a',a)) FROM t1;

+--------------------+--------------------------------+
| JSON_OBJECT('a',a) | JSON_VALID(JSON_OBJECT('a',a)) |
+--------------------+--------------------------------+
| {"a": 0000000001}  |                              0 |
+--------------------+--------------------------------+

Notice, the constructed JSON value is wrong. The 0000000001 literal should probably be quoted.


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