Bug #71530 JSON_EXTRACT returns wrong result in version 0.3
Submitted: 30 Jan 2014 16:39 Modified: 27 Feb 2014 11:54
Reporter: Sveta Smirnova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: JSON User-defined function ( UDF ) Severity:S3 (Non-critical)
Version:0.3.0, 0.3.1 OS:Any
Assigned to: CPU Architecture:Any

[30 Jan 2014 16:39] Sveta Smirnova
Description:
Created from a comment to bug #70393

Can't extract deeper after first element in array in version 0.3

How to repeat:
set @json = '[{"a":1,"b":2}, {"a":3,"b":4}]';
select CAST(json_extract(@json, 0, 'a') AS CHAR(10000));

returns: 1

set @json = '[{"a":1,"b":2}, {"a":3,"b":4}]';
select CAST(json_extract(@json, 1, 'a') AS CHAR(10000));

returns: NULL
expected: 3
[27 Feb 2014 11:53] Sveta Smirnova
Posted by developer:
 
Fixed in version 0.3.1