Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.6, 10.11, 11.4, 11.8, 12.2, 12.2.2
-
Unexpected results
-
Correct JSON_EXTRACT to return the correct results when its input is from a derived table. It previously incorrectly returned NULL.
Description
This is a perfectly valid query, which should produce the ["a",1] JSON document:
select
|
json_extract(t.j, '$')
|
from (
|
select json_extract('["a",1]', '$') as j
|
) as t;
|
Yet it produces NULL and a warning:
> Unexpected end of JSON text in argument 1 to function 'json_extract'
A workaround appears to be to "format" the JSON value:
select
|
json_extract(t.j, '$')
|
from (
|
select json_extract('["a", 1]', '$') as j -- There's a whitespace in ["a", 1]
|
) as t;
|
Now, I'm getting the document as expected:
> ["a", 1]