[MDEV-19487] JSON_TYPE doesnt detect the type of String Values (returns NULL) and for Date/DateTime returns "INTEGER" Created: 2019-05-15 Updated: 2023-04-27 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.2.22, 10.3.15, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Francisco Dueñas | Assignee: | Rucha Deodhar |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 10 64 bit |
||
| Issue Links: |
|
||||||||
| Description |
|
Hi this sentence:
Returns INTEGER, at least it should say 'STRING'
returns NULL, if you apply JSON_QUOTE for the JSON_VALUE returned value, it returns STRING. |
| Comments |
| Comment by Sergei Golubchik [ 2019-05-17 ] |
|
I'd say, both should be NULL. In the first query, JSON_VALUE() returns 2019-01-01 which is not a valid JSON literal, in the second query it returns Monty which is not a valid JSON literal either. If you'd use JSON_EXTRACT() instead of JSON_VALUE(), it'd return "2019-01-01" and "Monty", both are valid JSON strings. |