You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the functions gather negative value with length less than 4 and 8 bytes respectively, they loose sign. Now it can be seen only with isc_portable_integer() because standard providers use only 4 or 8 bytes for values. Third-party providers can ignore this old convention.
It seems that some bug exists in function _renderSizedIntegerForSPB from fdb package (http://services.py):
iRaw = struct.pack(myformat, i)
iConv = api.isc_vax_integer(iRaw, len(iRaw))
This function cuts off high 4 bytes when we pass to it bugint values greater than 2^31, i.e.:
2147483648L ==> reversed = b'\x00\x00\x00\x00\x00\x00\x00\x00'
-2147483649L ==> reversed = b'\x00\x00\x00\x00\x00\x00\x00\x00'
For this reason it was decided currently to limit scope by specifying numbers with abs() less than 2^31 - untill fdb driver will be fixed.
See letter from dimitr 08-jan-2018 20:56
The text was updated successfully, but these errors were encountered:
summary: isc_vax_integer() and isc_portable_integer() wron work with short negative numbers => isc_vax_integer() and isc_portable_integer() wrong work with short negative numbers
summary: isc_vax_integer() and isc_portable_integer() wrong work with short negative numbers => isc_vax_integer() and isc_portable_integer() work wrongly with short negative numbers
Test Details: Letter from dimitr, 28.12.2017 10:27 => It seems that some bug exists in function _renderSizedIntegerForSPB from fdb package (http://services.py):
iRaw = struct.pack(myformat, i)
iConv = api.isc_vax_integer(iRaw, len(iRaw))
This function cuts off high 4 bytes when we pass to it bugint values greater than 2^31, i.e.:
2147483648L ==> reversed = b'\x00\x00\x00\x00\x00\x00\x00\x00'
-2147483649L ==> reversed = b'\x00\x00\x00\x00\x00\x00\x00\x00'
For this reason it was decided currently to limit scope by specifying numbers with abs() less than 2^31 - untill fdb driver will be fixed.
See letter from dimitr 08-jan-2018 20:56
Submitted by: @aafemt
Assigned to: @aafemt
Attachments:
port_test.cpp.7z
When the functions gather negative value with length less than 4 and 8 bytes respectively, they loose sign. Now it can be seen only with isc_portable_integer() because standard providers use only 4 or 8 bytes for values. Third-party providers can ignore this old convention.
Commits: b039792 c678d20 0b0d6dd
====== Test Details ======
It seems that some bug exists in function _renderSizedIntegerForSPB from fdb package (http://services.py):
iRaw = struct.pack(myformat, i)
iConv = api.isc_vax_integer(iRaw, len(iRaw))
This function cuts off high 4 bytes when we pass to it bugint values greater than 2^31, i.e.:
2147483648L ==> reversed = b'\x00\x00\x00\x00\x00\x00\x00\x00'
-2147483649L ==> reversed = b'\x00\x00\x00\x00\x00\x00\x00\x00'
For this reason it was decided currently to limit scope by specifying numbers with abs() less than 2^31 - untill fdb driver will be fixed.
See letter from dimitr 08-jan-2018 20:56
The text was updated successfully, but these errors were encountered: