[MDEV-31477] Inconsistent handling while fetching values in json Created: 2023-06-14 Updated: 2023-09-12 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 11.2 |
| Fix Version/s: | 10.4, 11.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Ramesh Sivaraman | Assignee: | Rucha Deodhar |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
The JSON_KEY_VALUE() (in 11.2) , JSON_QUERY() and JSON_VALUE() function does not print a warning about syntax error if variable is combined with string.
Expected syntax error message
JSON_KEY_VALUE function should also print syntax error if the curly braces are not properly closed
in 10.4: MariaDB [test]> select json_extract(' {"key1": @json}', '$.key1');
-------------------------------------------
------------------------------------------- Warning (Code 4038): Syntax error in JSON text in argument 1 to function 'json_extract' at position 10 |
| Comments |
| Comment by Sergei Golubchik [ 2023-06-16 ] | ||||||||||||||||
|
should it be an error? for JSON_EXTRACT it's a warning
for JSON_VALUE it's just NULL
| ||||||||||||||||
| Comment by Rucha Deodhar [ 2023-06-16 ] | ||||||||||||||||
|
It should be a warning, behaviour should be uniform. There was a bug in Json_path_extractor::extract() function. Will fix it in the lowest version | ||||||||||||||||
| Comment by Rucha Deodhar [ 2023-06-20 ] | ||||||||||||||||
|
Patch: | ||||||||||||||||
| Comment by Alexey Botchkov [ 2023-09-12 ] | ||||||||||||||||
|
Patch looks mostly fine. |