Skip to content

Minimum hugeint overflows in conversion to PG numeric #593

Open
@JelteF

Description

@JelteF

Description

This query returns 0:

select * from duckdb.query($$ select '-170141183460469231731687303715884105728'::hugeint as result $$);

But one higher works fine:

select * from duckdb.query($$ select '-170141183460469231731687303715884105728'::hugeint + 1 as result $$);

The reason for this is that this line overflows, because the positive 170141183460469231731687303715884105728 cannot be represented in a signed int128.

Found by #577

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingincorrect resultBugs that return incorrect data

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions