Skip to content

BIN_SHR on INT128 does not apply sign extension #7603

@mrotteveel

Description

@mrotteveel

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions