The BIN_SHR function applies sign extension on SMALLINT, INTEGER and BIGINT values, but doesn't do so on INT128.
For example:
select bin_shr(cast(-1 as bigint), 1) as for_bigint, bin_shr(cast(-1 as int128), 1) for_int128
from rdb$database;
This returns
FOR_BIGINT FOR_INT128
===================== =============================================
-1 170141183460469231731687303715884105727
However, expected for FOR_INT128 would be -1 as well.
The
BIN_SHRfunction applies sign extension on SMALLINT, INTEGER and BIGINT values, but doesn't do so on INT128.For example:
This returns
However, expected for
FOR_INT128would be-1as well.