[MDEV-11433] JSON_MERGE returns a non-NULL result with a NULL argument Created: 2016-12-01  Updated: 2017-02-20  Resolved: 2016-12-05

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2
Fix Version/s: 10.2.3

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

Issue Links:
Relates
relates to MDEV-9143 JSON_xxx functions Closed

 Description   

Note: Since we don't have any documented differences between our implementation of JSON functions and Oracle's, here and further I will assume they are supposed to be result-compatible.

MariaDB 10.2

MariaDB [test]> select JSON_MERGE(NULL,JSON_OBJECT('foo', 1));
+----------------------------------------+
| JSON_MERGE(NULL,JSON_OBJECT('foo', 1)) |
+----------------------------------------+
| [null, {"foo": 1}]                     |
+----------------------------------------+
1 row in set (0.00 sec)

MySQL 5.7

MySQL [test]> select JSON_MERGE(NULL,JSON_OBJECT('foo', 1));
+----------------------------------------+
| JSON_MERGE(NULL,JSON_OBJECT('foo', 1)) |
+----------------------------------------+
| NULL                                   |
+----------------------------------------+
1 row in set (0.00 sec)

It is also documented in MySQL manual:
https://dev.mysql.com/doc/refman/5.7/en/json-modification-functions.html#function_json-merge

Returns NULL if any argument is NULL



 Comments   
Comment by Alexey Botchkov [ 2016-12-05 ]

http://lists.askmonty.org/pipermail/commits/2016-December/010213.html

Generated at Thu Feb 08 07:49:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.