redis / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.

Home Page:http://redis.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] `GETRANGE` returns incorrect response with negative indices

Yury-Fridlyand opened this issue · comments

Describe the bug
GETRANGE mykey -200 -100 returns a non-empty string

redis> GETRANGE mykey -200 -100
"T"

To reproduce

  1. Go to https://redis.io/docs/latest/commands/getrange/
  2. 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

thanks, it's fixed in #12272

good news! Sorry, I failed to find that.