[MDEV-31464] JSON_ARRAY_INTERSECT function prints zero when leading zero is present in a decimal integer Created: 2023-06-12  Updated: 2023-06-16  Resolved: 2023-06-16

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

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Rucha Deodhar
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-31478 Inconsistent handling of zero-padded ... Open

 Description   

JSON_ARRAY_INTERSECT function prints zero when leading zero is present in a decimal integer.

11.1.0-dbg>select json_array_intersect('[01]','[01]');
+-------------------------------------+
| json_array_intersect('[01]','[01]') |
+-------------------------------------+
| [0]                                 |
+-------------------------------------+
1 row in set (0.000 sec)
 
11.1.0-dbg>



 Comments   
Comment by Ramesh Sivaraman [ 2023-06-16 ]

The issue is also present in JSON_VALUE

11.1.0-dbg>select json_value('{"key1":010}', '$.key1');
+--------------------------------------+
| json_value('{"key1":010}', '$.key1') |
+--------------------------------------+
| 0                                    |
+--------------------------------------+
1 row in set (0.000 sec)
 
11.1.0-dbg>

Generated at Thu Feb 08 10:24:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.