[MDEV-15909] JSON_VALID treats integers as valid JSON Created: 2018-04-17  Updated: 2018-04-17  Resolved: 2018-04-17

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2.11
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Nick Andren Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

The JSON_VALID function notes that integers are valid JSON objects.

Query to Reproduce

SELECT JSON_VALID(12345);

Result:

+-------------------+
| JSON_VALID(12345) |
+-------------------+
|                 1 |
+-------------------+

Expected result:

+-------------------+
| JSON_VALID(12345) |
+-------------------+
|                 0 |
+-------------------+



 Comments   
Comment by Nick Andren [ 2018-04-17 ]

I just learned that simple types are valid according to the RFC 7158. From page 12:

   Here are three small JSON texts containing only values:
   "Hello world!"
   42
   true

So this is working per the specification. Please close this ticket.

Generated at Thu Feb 08 08:24:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.