Bug #94365 JSON_SEARCH do not search if JSON_ARRAY is a serch value

Submitted: 16 Feb 2019 10:50 Modified: 18 Mar 2019 15:22
Reporter: Anrii Pertsiukh Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: JSON Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[16 Feb 2019 10:50] Anrii Pertsiukh
Description:
The search_str search string argument of JSON_SEARCH can't process JSON_ARRAY

How to repeat:
SET @a=JSON_OBJECT('a', JSON_ARRAY(JSON_OBJECT('file', 'name1'), JSON_OBJECT('file', 'name2'), JSON_OBJECT('file', 'name3')));
SET @s=JSON_ARRAY('name2', 'name3');

SELECT JSON_SEARCH(@a, 'all', 'name3');
returns:
"$.a[2].file"

SELECT JSON_SEARCH(@a, 'all', @s);
returns: 
null

should return:
["$.a[1].file", "$.a[2].file"]

Suggested fix:
Allow to use JSON_ARRAY as search_str argument JSON_SEARCH
[18 Mar 2019 15:22] MySQL Verification Team
Hi,

Thank you for your report.

I find that your idea is very good.

Verified as a feature request.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.