zkteco-home / redis-windows

Native port of Redis for Windows,it can be installed as service.
MIT License
1.91k stars 173 forks source link

Range index is wrong. #2

Closed HoytRen closed 2 years ago

HoytRen commented 2 years ago

redis_version:6.2.6 According to https://redis.io/commands/zrange, Command: zrange XXX 0 -1 should return all members in that zSet, but it currently return only 1 member. I tried the cli and Lettuce(java), both interfaces have this problem.

zkteco-home commented 2 years ago

thank you,i will check it and fix it

zkteco-home commented 2 years ago

I fixed this issue,please check it and give me feedback,thanks

HoytRen commented 2 years ago

Thanks for the quick fix. -1 is working now. Here is still problem about the index. zrange test 0 (1 produce an error, but it shoud return the first member.

zkteco-home commented 2 years ago

i use this command to test it, ZRANGE myset 0 0 ,it is ok,please tell your command details,thanks image

HoytRen commented 2 years ago

Let me explain: zrange test 0 (1 and zrange test 0 1 are different. Here isn't typo. You could notice here is a '('. when zrange test 0 1 return the first and second members, the zrange test 0 (1 return only the first member.

HoytRen commented 2 years ago

zrange test 0 (1 and zrange test 0 0 should have same results, but it doesn't work currently.

zkteco-home commented 2 years ago

ok,i will continue to check,your command is zrange test 0 (1 BYSCORE

zkteco-home commented 2 years ago

Let me explain: zrange test 0 (1 and zrange test 0 1 are different. Here isn't typo. You could notice here is a '('. when zrange test 0 1 return the first and second members, the zrange test 0 (1 return only the first member.

i fixed this issue and commited,please check again,thanks

HoytRen commented 2 years ago

I replaced the redis binary, checked the timestamp of the files and restarted computer. It seems something wrong, and the zrange test 0 (1 still produce a error: 127.0.0.1:6379> zadd test 1 a 2 b 3 c (integer) 3 127.0.0.1:6379> zrange test 0 (1 (error) ERR value is not an integer or out of range 127.0.0.1:6379>

zkteco-home commented 2 years ago

I replaced the redis binary, checked the timestamp of the files and restarted computer. It seems something wrong, and the zrange test 0 (1 still produce a error: 127.0.0.1:6379> zadd test 1 a 2 b 3 c (integer) 3 127.0.0.1:6379> zrange test 0 (1 (error) ERR value is not an integer or out of range 127.0.0.1:6379>

image this is my test screenshot

if you want to use (,you must add param BYSCORE

according to https://redis.io/commands/zrange/

zkteco-home commented 2 years ago

image

zkteco-home commented 2 years ago

image

HoytRen commented 2 years ago

Sorry, I made mistake and you are right. "(" is a feature of zrangebyscore or 'zrange XXX X X byscore' but not for zrange. I confirm the redis works all right and this issue is resolved now. Thank you again.