-
Notifications
You must be signed in to change notification settings - Fork 222
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
Problem about overflow inspection of INCRBY/DECRBY #291
Comments
z4deepfz
changed the title
Problem of overflow inspection of INCRBY/DECRBY
Problem about overflow inspection of INCRBY/DECRBY
Aug 25, 2022
Thanks for opening this issue.
I found the cause of it and some potential issues as well. I would like to make a patch to miniredis if it is indeed an unexpected behavior of miniredis.
Sounds like a good improvement to me, a PR would be appreciated.
|
wszaranski
added a commit
to wszaranski/miniredis
that referenced
this issue
Mar 15, 2024
Fixes INCR, DECR, INCRBY, DECRBY overflow to return proper error message. Closes: alicebob#291 Signed-off-by: Wojciech Szarański <wojciech.szaranski@gmail.com>
wszaranski
added a commit
to wszaranski/miniredis
that referenced
this issue
Mar 15, 2024
Fixes INCR, DECR, INCRBY, DECRBY to return proper message when value would overflow. Closes: alicebob#291 Signed-off-by: Wojciech Szarański <wojciech.szaranski@gmail.com>
Merged
wszaranski
added a commit
to wszaranski/miniredis
that referenced
this issue
Mar 15, 2024
Fixes INCR, DECR, INCRBY, DECRBY to return error when value would overflow. Closes: alicebob#291 Signed-off-by: Wojciech Szarański <wojciech.szaranski@gmail.com>
alicebob
pushed a commit
that referenced
this issue
Mar 23, 2024
Fixes INCR, DECR, INCRBY, DECRBY to return error when value would overflow. Closes: #291 Signed-off-by: Wojciech Szarański <wojciech.szaranski@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Miniredis throws out no error of overflowing when the value becomes greater than
math.MaxInt64
afterINCRBY
orDECRBY
(alsoINCR
orDECR
). Instead it returns a negative number which was exactly the overflowed value. As a comparison, the real redis instance returnsERR increment or decrement would overflow
which thrown out by overflow detection and nothing will be changed.I found the cause of it and some potential issues as well. I can make a patch to it if it is indeed an unexpected behavior of miniredis.
The following code reproduces the problem.
The text was updated successfully, but these errors were encountered: