TZRowAccessor.CompareBuffers
Posted: 18.08.2014, 09:37
Hello,
in some situation there seems to be a problem in the function mentioned above :
...
stInteger:
Result := PInteger(ValuePtr1)^ - PInteger(ValuePtr2)^;
...
the "old" value in my integer-column is somewhat with 3.000.000, the new one is about -2.147.480.000.
Both values are inside the signed-integer-range (-2.147.483.648 .. +2.147.483.647), but the result of
3.000.000 - (-2.147.480.000) = 2.150.480.000 is not - Delphi raises an exception.
Same situation may occur with Int64, because the function "CompareInt64" uses the same calculation and "Integer" as result.
Because "CompareInt64" inside "CompareBuffers" (and also the other "CompareXY" functions) normally just return "1", "0" or "-1", will it be possible to do this also with "stInteger" (but with a different calculation, of cause) ?
Thanks,
with best regards
Andreas
in some situation there seems to be a problem in the function mentioned above :
...
stInteger:
Result := PInteger(ValuePtr1)^ - PInteger(ValuePtr2)^;
...
the "old" value in my integer-column is somewhat with 3.000.000, the new one is about -2.147.480.000.
Both values are inside the signed-integer-range (-2.147.483.648 .. +2.147.483.647), but the result of
3.000.000 - (-2.147.480.000) = 2.150.480.000 is not - Delphi raises an exception.
Same situation may occur with Int64, because the function "CompareInt64" uses the same calculation and "Integer" as result.
Because "CompareInt64" inside "CompareBuffers" (and also the other "CompareXY" functions) normally just return "1", "0" or "-1", will it be possible to do this also with "stInteger" (but with a different calculation, of cause) ?
Thanks,
with best regards
Andreas