[MDEV-30412] JSON_OBJECTAGG doesn't escape double quote in key Created: 2023-01-15  Updated: 2023-02-14  Resolved: 2023-02-14

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.9.3, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.11.3, 11.0.1, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Major
Reporter: Stephen Rogers Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: None
Environment:

OpenBSD 7.2


Issue Links:
Relates
relates to MDEV-16620 Add support for JSON_ARRAYAGG and JSO... Closed

 Description   

MariaDB [(none)]> SELECT JSON_OBJECT('"', 1), JSON_OBJECTAGG('"', 1);
+---------------------+------------------------+
| JSON_OBJECT('"', 1) | JSON_OBJECTAGG('"', 1) |
+---------------------+------------------------+
| {"\"": 1}           | {""":1}                |
+---------------------+------------------------+
1 row in set (0.000 sec)

works correctly in MySQL 5.6



 Comments   
Comment by Weijun Huang [ 2023-02-12 ]

This bug also happens in MasOS.

MariaDB Version 10.5.16-MariaDB-debug
 - SSL connections supported
 - binaries are debug compiled
 - binaries built with wsrep patch
Collecting tests...
Installing system database...
 
==============================================================================
 
TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------
 
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
SELECT JSON_OBJECT('"', 1), JSON_OBJECTAGG('"', 1);
JSON_OBJECT('"', 1)     JSON_OBJECTAGG('"', 1)
{"\"": 1}       {""":1}
main.json_test                           [ pass ]       
--------------------------------------------------------------------------
The servers were restarted 0 times
Spent 0.000 of 7 seconds executing testcases
 
Completed: All 1 tests were successful.

Comment by Daniel Black [ 2023-02-14 ]

Thanks to Weijun / Alex Huang

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