[MDEV-25881] JSON_TABLE can't handle an array properly Created: 2021-06-09 Updated: 2024-02-02 Resolved: 2022-07-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.6.1 |
| Fix Version/s: | 10.6.9 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Deepak Vohra | Assignee: | Rucha Deodhar |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | JSON, JSON_TABLE | ||
| Environment: |
Docker image : mariadb:10.6.1 |
||
| Issue Links: |
|
||||||||||||
| Description |
|
JSON_TABLE does not process a JSON array properly for a JSON type path. Use case example:
Expected Output:
Actual Output:
MySQL 8 generates expected output. |
| Comments |
| Comment by Sergei Petrunia [ 2021-06-09 ] | ||||||||||||||||
|
The observed behavior is what is expected of the current code. The SQL Standard specifies that it is an error when column path points to a non-scalar value. The default "ON ERROR" behavior is to emit NULL, this is why the query produces NULLs. MySQL's behavior is their extension. It is very reasonable though, and we are already looking at implementing it, see | ||||||||||||||||
| Comment by Rucha Deodhar [ 2022-07-21 ] | ||||||||||||||||
|
Can't repeat anymore on 10.6 commit hash : 654236c06d231461c66e2f3c5c4fd3b35cba3869 | ||||||||||||||||
| Comment by Rucha Deodhar [ 2022-07-21 ] | ||||||||||||||||
|
Seems it is fixed already. Can't repeat anymore on commit: 654236c06d231461c66e2f3c5c4fd3b35cba3869 |