-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Queryable Encryption
-
Server Security
-
Fully Compatible
-
ALL
-
v8.0
-
Security 2024-07-08, Security 2024-07-22
I have a FLE2 range field of type "double", with min = 0.0 , max = 2^53 , and precision = 0 , I expected that the ceil( log2((max - min + 1) * 10^prc )) calculation for determining precision mode will give me a value of 54 , however the result I get is 53 . I checked the floating-point arithmetic, and it was because (max - min + 1) = 2^53 + 1 and 2^53 + 1 is not exactly representable as a double value (not enough mantissa bits), so the actual value of (max - min + 1) is just 2^53.
If I try to insert the value 2^53 for this field, that will run the getTypeInfoDouble function with a value 2^53 (i.e. the max value), and the code crashes due to this invariant. It's because the new max value is 2^53 - 1 instead of 2^54 - 1.
- is depended on by
-
MONGOCRYPT-702 FLE2 range floating point correctness issue when using precision mode
- Closed
- is related to
-
SERVER-92504 Fix can use precision mode dec128
- Closed
-
MONGOCRYPT-702 FLE2 range floating point correctness issue when using precision mode
- Closed