mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Fix XRANGE COUNT option for value of 0.
This commit is contained in:
parent
f06e8c331c
commit
6e11ef30e0
@ -1260,7 +1260,7 @@ void xrangeGenericCommand(client *c, int rev) {
|
|||||||
robj *o;
|
robj *o;
|
||||||
stream *s;
|
stream *s;
|
||||||
streamID startid, endid;
|
streamID startid, endid;
|
||||||
long long count = 0;
|
long long count = -1;
|
||||||
robj *startarg = rev ? c->argv[3] : c->argv[2];
|
robj *startarg = rev ? c->argv[3] : c->argv[2];
|
||||||
robj *endarg = rev ? c->argv[2] : c->argv[3];
|
robj *endarg = rev ? c->argv[2] : c->argv[3];
|
||||||
|
|
||||||
@ -1287,8 +1287,14 @@ void xrangeGenericCommand(client *c, int rev) {
|
|||||||
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptymultibulk)) == NULL
|
if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.emptymultibulk)) == NULL
|
||||||
|| checkType(c,o,OBJ_STREAM)) return;
|
|| checkType(c,o,OBJ_STREAM)) return;
|
||||||
s = o->ptr;
|
s = o->ptr;
|
||||||
|
|
||||||
|
if (count == 0) {
|
||||||
|
addReply(c,shared.nullmultibulk);
|
||||||
|
} else {
|
||||||
|
if (count == -1) count = 0;
|
||||||
streamReplyWithRange(c,s,&startid,&endid,count,rev,NULL,NULL,0,NULL);
|
streamReplyWithRange(c,s,&startid,&endid,count,rev,NULL,NULL,0,NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* XRANGE key start end [COUNT <n>] */
|
/* XRANGE key start end [COUNT <n>] */
|
||||||
void xrangeCommand(client *c) {
|
void xrangeCommand(client *c) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user