[MDEV-17001] JSON_MERGE returns nullwhen merging empty array Created: 2018-08-16  Updated: 2018-09-13  Resolved: 2018-09-13

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2.12, 10.2, 10.3
Fix Version/s: 10.2.18

Type: Bug Priority: Major
Reporter: Buba Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None
Environment:

CentOS 7 (64bit)


Issue Links:
Relates
relates to MDEV-17121 JSON_ARRAY_APPEND Closed

 Description   

Issue

 SELECT JSON_MERGE('[1]', '[]');
+-------------------------+
| JSON_MERGE('[1]', '[]') |
+-------------------------+
| NULL                    |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
 
SHOW WARNINGS;
+---------+------+--------------------------------------------------------------------------------+
| Level   | Code | Message                                                                        |
+---------+------+--------------------------------------------------------------------------------+
| Warning | 4038 | Syntax error in JSON text in argument 1 to function 'json_merge' at position 5 |
+---------+------+--------------------------------------------------------------------------------+

Expected Result

 SELECT JSON_MERGE('[1]', '[]');
+-------------------------+
| JSON_MERGE('[1]', '[]') |
+-------------------------+
| [1]                    |
+-------------------------+



 Comments   
Comment by Elena Stepanova [ 2018-08-29 ]

Thanks for the report.

Comment by Alexey Botchkov [ 2018-09-13 ]

http://lists.askmonty.org/pipermail/commits/2018-September/012923.html

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