Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum hugeint overflows in conversion to PG numeric #593

Open
JelteF opened this issue Feb 14, 2025 · 0 comments
Open

Minimum hugeint overflows in conversion to PG numeric #593

JelteF opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working incorrect result Bugs that return incorrect data

Comments

@JelteF
Copy link
Collaborator

JelteF commented Feb 14, 2025

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

@JelteF JelteF added bug Something isn't working incorrect result Bugs that return incorrect data labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working incorrect result Bugs that return incorrect data
Projects
None yet
Development

No branches or pull requests

1 participant