[MDEV-13645] JSON_QUOTE() - return NULL on numbers Created: 2017-08-25 Updated: 2023-02-15 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.2.8 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Michal Hucik | Assignee: | Rucha Deodhar |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos Linux 7.3 |
||
| Description |
|
I'm not sure if this is really a bug, but why JSON_QUOTE () returns NULL when the input parameter is not a string, but a number? My opinion in that case, is that the return value must be the same as input number.
|
| Comments |
| Comment by Elena Stepanova [ 2017-08-25 ] | |||
|
Thanks for the report. At least there is a documentation problem. In MySQL 5.7 it also does not work:
However, there JSON_QUOTE is clearly documented as a function with a string argument, so the failure is justified. In MariaDB, JSON_QUOTE is documented as a function with json_value argument (whatever it means). Also, even though we implemented implicit "NULL upon error" logic for JSON functions, there should be a warning if the argument is incorrect, so it's another example for | |||
| Comment by Weijun Huang [ 2023-02-15 ] | |||
|
In MySQL 8.0, it also does not work. |