[MDEV-24631] JSON_EXTRACT returns result in document and not in path order Created: 2021-01-20 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.5.5, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Johan Wikman | Assignee: | Rucha Deodhar |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Consider the following:
The selected field values are returned in the order in which they appear in the document, and not in the order of the path arguments given to JSON_EXTRACT. The documentation at https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-extract states If it is possible that those arguments could return multiple values, the matched values are autowrapped as an array, in the order corresponding to the paths that produced them. Indeed, unless that is done, multiple path arguments cannot be used, as you will not know which returned value corresponds to which path. |
| Comments |
| Comment by Alice Sherepa [ 2021-01-20 ] | ||||||||||||||||
|
Tnanks for the report! Reproducible on 10.2-10.5
|