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

fix: Big Number support for incrementors in redis #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkeen
Copy link
Contributor

@mkeen mkeen commented Aug 11, 2023

Big Numbers (mostly seen in token total supply, etc) will cause crashes unless we use INCRBYFLOAT.

RESP3 lays out how much memory we can use for Big Numbers (64 bits)

You can try the command with and without INCRBYFLOAT using a large 64 bit unsigned integer or signed integer to see the difference it makes.

redis> INCRBY mykey 18446744073709551615
redis> error: "ERR value is not an integer or out of range"
redis> INCRBYFLOAT mykey 18446744073709551615
redis> success: "350488137400481481280"
redis> HINCR myhash field 18446744073709551615
redis> error: "ERR value is not an integer or out of range"
redis> HINCRBYFLOAT myhash field 18446744073709551615
redis> success: "350488137400481481280"

@mkeen mkeen requested a review from scarmuega as a code owner August 11, 2023 09:21
@mkeen mkeen changed the title fix: u64 support for incrementors in redis fix: Big Number support for incrementors in redis Aug 11, 2023
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

Successfully merging this pull request may close these issues.

1 participant