git-hulk commented on code in PR #1492:
URL:
https://github.com/apache/incubator-kvrocks/pull/1492#discussion_r1227800004
##########
tests/gocase/unit/type/zset/zset_test.go:
##########
@@ -439,6 +440,23 @@ func basicTests(t *testing.T, rdb *redis.Client, ctx
context.Context, encoding s
{4, "d"},
}, rdb.ZRangeWithScores(ctx, "ztmp", 0, -1).Val())
+ for i := 0; i < 10; i++ {
+ cmd := rdb.ZRangeArgs(ctx, redis.ZRangeArgs{Key:
"ztmp", Count: 0, ByScore: true, Start: 0, Stop: -1, Offset: int64(i)})
+ require.Equal(t, []string{}, cmd.Val())
Review Comment:
https://github.com/redis/go-redis/blame/0bdc7dd8986e4923b3309f880245b9311d09f273/commands.go#L2790
won't append the `LIMIT offset,count` if the offset and counter are zero. So
for the kvrocks side, it will regard it as the default value which is offset =
0 and count = -1.
By the way, we should check the error first before comparing the value. Same
as the following lines, we need to prevent the limit and counter are 0 at the
same time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]