[MDEV-14778] NULL is a valid JSON document Created: 2017-12-27 Updated: 2017-12-27 Resolved: 2017-12-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | JSON |
| Affects Version/s: | 10.2.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | richardeaxon | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos 7 |
||
| Description |
|
Using the following test table:
And then running the following queries:
I expect a new JSON document to be created as per JSON lint and RFC 7159 as per the following URL's as NULL is a valid JSON document. https://stackoverflow.com/questions/8526995/is-null-valid-json-4-bytes-nothing-else This goes against the MariaDB documentation that states NULL will result in a NULL document: Updates or inserts data into a JSON document, returning the result, or NULL if any of the arguments are NULL or the optional path fails to find an object. I think MariaDB implements an older JSON standard preventing creation of a new document into a NULL column. Or is there another way to achieve the above JSON_SET to create a new document? |
| Comments |
| Comment by richardeaxon [ 2017-12-27 ] | |||||||||||||||
|
Workaround is:
| |||||||||||||||
| Comment by Sergei Golubchik [ 2017-12-27 ] | |||||||||||||||
|
the first link says
But SQL NULL is not a "literal token null", it's an absence of value. See
|