mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Merge pull request #4935 from soloestoy/bugfix-zpop
bugfix for ZPOP: fix the wrong keyc, should be 1
This commit is contained in:
commit
f1321349d3
@ -3080,8 +3080,8 @@ void zscanCommand(client *c) {
|
|||||||
* use the 'count' argument to return multiple items if available. */
|
* use the 'count' argument to return multiple items if available. */
|
||||||
void genericZpopCommand(client *c, robj **keyv, int keyc, int where, int emitkey, robj *countarg) {
|
void genericZpopCommand(client *c, robj **keyv, int keyc, int where, int emitkey, robj *countarg) {
|
||||||
int idx;
|
int idx;
|
||||||
robj *key;
|
robj *key = NULL;
|
||||||
robj *zobj;
|
robj *zobj = NULL;
|
||||||
sds ele;
|
sds ele;
|
||||||
double score;
|
double score;
|
||||||
long count = 1;
|
long count = 1;
|
||||||
@ -3185,7 +3185,7 @@ void zpopminCommand(client *c) {
|
|||||||
addReply(c,shared.syntaxerr);
|
addReply(c,shared.syntaxerr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
genericZpopCommand(c,&c->argv[1],c->argc-1,ZSET_MIN,0,
|
genericZpopCommand(c,&c->argv[1],1,ZSET_MIN,0,
|
||||||
c->argc == 3 ? c->argv[2] : NULL);
|
c->argc == 3 ? c->argv[2] : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3195,7 +3195,7 @@ void zpopmaxCommand(client *c) {
|
|||||||
addReply(c,shared.syntaxerr);
|
addReply(c,shared.syntaxerr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
genericZpopCommand(c,&c->argv[1],c->argc-1,ZSET_MAX,0,
|
genericZpopCommand(c,&c->argv[1],1,ZSET_MAX,0,
|
||||||
c->argc == 3 ? c->argv[2] : NULL);
|
c->argc == 3 ? c->argv[2] : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user