1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-30705: JSON_SCHEMA_VALID: schema with multipleOf for big value

always return 1

Analysis: Implementation used double to store value. longlong is better
choice
Fix: Use longlong for multiple_of and the value to store it and num_flag to
check for decimals.
This commit is contained in:
Rucha Deodhar
2023-03-03 13:50:46 +05:30
parent 2c4c7c8b02
commit 4b67ff3b25
4 changed files with 44 additions and 8 deletions

View File

@ -3533,4 +3533,15 @@ SET @schema= '{ "items" : ["str1"]}';
SELECT JSON_SCHEMA_VALID(@schema, '[]');
--echo #
--echo # MDEV-30705: JSON_SCHEMA_VALID: schema with multipleOf for big value always return 1
--echo #
SET @schema = '{
"multipleOf": 2
}';
SELECT JSON_SCHEMA_VALID(@schema, '9007900000000001');
SELECT JSON_SCHEMA_VALID(@schema, '9007900000000060');
SELECT JSON_SCHEMA_VALID(@schema, '9007900000000061');
--echo # End of 11.1 test