[BUG] `GETRANGE` returns incorrect response with negative indices
Yury-Fridlyand opened this issue · comments
Yury-Fridlyand commented
Describe the bug
GETRANGE mykey -200 -100
returns a non-empty string
redis> GETRANGE mykey -200 -100
"T"
To reproduce
- Go to https://redis.io/docs/latest/commands/getrange/
- Submit
GETRANGE mykey -200 -100
Expected behavior
Should return an empty string due to incorrect range specified
Additional information
Reproduced on 7.2.4
Bonus
redis> getrange mykey -0 2
(error) value is not an integer or out of range
debing.sun commented
thanks, it's fixed in #12272
Yury-Fridlyand commented
good news! Sorry, I failed to find that.