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

unsafe int8 json #24

Open
exe-dealer opened this issue Aug 30, 2021 · 1 comment
Open

unsafe int8 json #24

exe-dealer opened this issue Aug 30, 2021 · 1 comment

Comments

@exe-dealer
Copy link
Member

exe-dealer commented Aug 30, 2021

select to_json(int8(9007199254740991 + 1))

JSON.parse parses all numbers as 53bit integers . When number is too big then JSON.parse silently loose precision what is not safe. Need to fix JSON.parse behavior (which will degrade perfomance) or document this pitfall

@jmealo
Copy link

jmealo commented Jan 19, 2024

A minimal solution... perhaps folks could opt to have these values read as strings or bigint? I don't think the default behavior being to lose precision makes sense.
https://gist.github.com/jarrodek/24d32cb6a03c40b11fe77651ba223257

A more complete solution:
https://github.com/sidorares/json-bigint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants