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

CommandArgs using Long.MIN_VALUE results in 0 #2019

Closed
stillerrr opened this issue Feb 22, 2022 · 1 comment
Closed

CommandArgs using Long.MIN_VALUE results in 0 #2019

stillerrr opened this issue Feb 22, 2022 · 1 comment
Labels
type: bug A general bug
Milestone

Comments

@stillerrr
Copy link

stillerrr commented Feb 22, 2022

Bug Report

Current Behavior

use lettuce incrby command: incrby key Long.MIN_VALUE, the result is 0, not Long.MIN_VALUE

command: incrby key Long.MIN_VALUE

excepted value: Long.MIN_VALUE

actual value: 0

Environment

  • Lettuce version(s): 5.2.0.RELEASE
  • Redis version: 4.0.11

Possible Solution

io.lettuce.core.RedisCommandBuilder incrby method would add count to CommandArgs
image
then go IntegerArgument.of() method
image

and for this place, -Long.MIN_VALUE == Long.MIN_VALUE, so the result is true
image

finally this place would make the count as 0
image

so the command: incrby key Long.MIN_VALUE result is 0

Additional context

@mp911de mp911de added the type: bug A general bug label Feb 22, 2022
@mp911de mp911de added this to the 6.1.7 milestone Feb 25, 2022
@mp911de mp911de changed the title Command: incrby key Long.MIN_VALUE, Result is 0 not Long.MIN_VALUE CommandArgs using Long.MIN_VALUE results in 0 Feb 25, 2022
mp911de added a commit that referenced this issue Feb 25, 2022
We now correctly check the cache bounds for negative integer arguments.
mp911de added a commit that referenced this issue Feb 25, 2022
We now correctly check the cache bounds for negative integer arguments.
@mp911de
Copy link
Collaborator

mp911de commented Feb 25, 2022

That's fixed now.

@mp911de mp911de closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants