MOD-6501, MOD-4551, MOD-4856, MOD-5714: fix crash from converting u64 to i64 #1192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Indexing
NUMERIC
fields has unchanged behavior.NUMERIC
field with value greater thani64::min
(-2^63
), but less thani64::max
(2^63 - 1
) is indexed asi64
. It does not lose precision. Its type isinteger
.NUMERIC
field with value greater thani64::max
(2^63 - 1
), but less thanu64::max
(2^64 - 1
) is indexed asu64
. It does not lose precision. Its type isinteger
.NUMERIC
field with value greater thanu64::max
(2^64 - 1
), or lower thani64::min
(-2^63
), or containing a decimal point, is indexed asf64
. Its type isnumber
. This may implicate losing precision, but this is not a breaking change.NUMINCRBY
behavior changed to prevent crash.i64 + i64
whose result is betweeni64::min
andi64::max
has unchanged behavior. Its result is stored asi64
, its type isinteger
.i64 + i64
whose result is greater thani64::max
or less thani64::min
explicitly wraps instead of invoking undefined behavior. Its result is stored asi64
, its type isinteger
.i64 + u64
andu64 + u64
behavior is unchanged. Its result is stored asf64
, its type isnumber
. This may implicate losing precision, but this is not a breaking change.u64 + i64
used to crash. Now it behaves consistently with the prior case.f64
, the result is stored asf64
, with typenumber
.DROP
ofinteger
s stored asu64
no longer crashes.This PR only affects
NUMERIC
fields using vanilla JSON, not those using HDT.Which issues this PR fixes
Main objects this PR modified