[MDEV-30705] JSON_SCHEMA_VALID: schema with multipleOf for big value always return 1 Created: 2023-02-21  Updated: 2023-11-27  Resolved: 2023-04-21

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
Relates
relates to MDEV-31104 Implement strntold (string to long do... Open

 Description   

The big value dependencies on multipleOf. So, for example, for multipleOf=2 the big values starts from 9007900000000001:

SET @schema = '{
                  "multipleOf": 2
                }';
SELECT JSON_SCHEMA_VALID(@schema, '9006999999999999');
SELECT JSON_SCHEMA_VALID(@schema, '9007900000000001');

Actual result:

SELECT JSON_SCHEMA_VALID(@schema, '9006999999999999');
JSON_SCHEMA_VALID(@schema, '9006999999999999')
0
SELECT JSON_SCHEMA_VALID(@schema, '9007900000000001');
JSON_SCHEMA_VALID(@schema, '9007900000000001')
1

Expected result:

SELECT JSON_SCHEMA_VALID(@schema, '9006999999999999');
JSON_SCHEMA_VALID(@schema, '9006999999999999')
0
SELECT JSON_SCHEMA_VALID(@schema, '9007900000000001');
JSON_SCHEMA_VALID(@schema, '9007900000000001')
0



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

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

Comment by Alexey Botchkov [ 2023-04-20 ]

ok to push.
once we employ the my_decimal for the validation, this part also should be modified.

Comment by Rucha Deodhar [ 2023-04-21 ]

Pushed to: https://github.com/MariaDB/server/tree/bb-10.12-MDEV-27128

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