Ildar Absalyamov has posted comments on this change.

Change subject: Fix for integer numeric overflow in integer constructors
......................................................................


Patch Set 1:

(2 comments)

As we have discussed applied the same verification logic to int64 constructor

https://asterix-gerrit.ics.uci.edu/#/c/1509/1/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java
File 
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/constructors/AInt16ConstructorDescriptor.java:

PS1, Line 92:  short limit = -Short.MAX_VALUE
> Why's there a difference now in limit, aren't we always accumulating in the
Limit itself will always be a negative, but depending on whether we are parsing 
a positive or a negative number the limit would be different (e.g. the limit if 
-127 for positive int8, but -128 for negative int8)


PS1, Line 113: value < limit)
> Why does this signify an overflow?
Changed validation logic a bit. See the new patchset for the correct version.
Consider an example when we are parsing a string "-129". At the point when we 
have parsed 120 the condition -120 < -128+9 will fail, signifying that the 
parsed value is out of domain boundaries. If we were to check -120 - 9 < -128 
we will have an overflow while computing the left side.


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1509
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0cb3411bf9a808ee87f4938c60804a8d267c36d0
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Ildar Absalyamov <[email protected]>
Gerrit-Reviewer: Ian Maxon <[email protected]>
Gerrit-Reviewer: Ildar Absalyamov <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-HasComments: Yes

Reply via email to