[MDEV-30677] Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)" Created: 2023-02-17  Updated: 2023-11-27  Resolved: 2023-05-03

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: None
Fix Version/s: 11.1.1

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-27128 Implement JSON Schema Validation FUNC... Closed

 Description   

If at least one of the arguments is NULL, the function returns NULL.

(https://dev.mysql.com/doc/refman/8.0/en/json-validation-functions.html)

So for case:

SELECT JSON_SCHEMA_VALID('{}', NULL);

Expected result:

JSON_SCHEMA_VALID('{}', NULL)
NULL

Actual result:

JSON_SCHEMA_VALID('{}', NULL)
1

Full MTR case for NULL:

SELECT JSON_SCHEMA_VALID(NULL, NULL);
SELECT JSON_SCHEMA_VALID('{}', NULL);
SELECT JSON_SCHEMA_VALID(NULL, '{}');



 Comments   
Comment by Rucha Deodhar [ 2023-03-02 ]

patch: https://github.com/MariaDB/server/tree/bb-MDEV-30677-json_schema

Comment by Alexey Botchkov [ 2023-04-21 ]

see comments on the patch.

Comment by Alexey Botchkov [ 2023-04-26 ]

ok to push.

Generated at Thu Feb 08 10:18:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.