Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
N/A
-
None
Description
For the schema with type=number all objects starts with number or minus is validated as correct:
Test:
SET @schema= '{"type":"number"}'; |
|
SELECT JSON_SCHEMA_VALID(@schema, '3.14'); |
SELECT JSON_SCHEMA_VALID(@schema, '0zzzz'); |
SELECT JSON_SCHEMA_VALID(@schema, '-#'); |
Expected result:
JSON_SCHEMA_VALID(@schema, '3.14') |
1
|
|
JSON_SCHEMA_VALID(@schema, '0zzzz') |
0
|
|
SELECT JSON_SCHEMA_VALID(@schema, '-#') |
0
|
It may be also necessary to generate a warning like here:
SELECT JSON_SCHEMA_VALID(@schema, '.0'); |
JSON_SCHEMA_VALID(@schema, '.0') |
0
|
Warnings:
|
Warning 4038 Syntax error in JSON text in argument 3 to function 'json_schema_valid' at position 1 |
Actual result:
JSON_SCHEMA_VALID(@schema, '3.14') |
1
|
|
JSON_SCHEMA_VALID(@schema, '0zzzz') |
1
|
|
SELECT JSON_SCHEMA_VALID(@schema, '-#') |
1
|
Attachments
Issue Links
- is caused by
-
MDEV-27128 Implement JSON Schema Validation FUNCTION
- Closed