Details
-
Type:
Bug
-
Status: Open (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 10.5.11
-
Fix Version/s: None
-
Labels:None
Description
The following query wraps JSON from a derived table in more JSON:
select json_array(`v1`) from (select json_array(1) as `v1`) as `t`
|
This results in undesirable output:
["[1]"]
|
It doesn't happen with scalar subqueries:
select json_array((select json_array(1) as `v1`))
|
Or with the usual laborious workaround for such problems:
select json_array(json_merge_preserve('[]', `v1`))
|
from (select json_array(1) as `v1`) as `t`
|
Both resulting in the expected output
[[1]]
|
For comparison, MySQL 8.0.22 doesn't behave this way.