diff options
Diffstat (limited to 'src/t_set.c')
-rw-r--r-- | src/t_set.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/t_set.c b/src/t_set.c index 7c71dfc2f..64bbbd3a0 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -476,7 +476,7 @@ void spopWithCountCommand(client *c) { /* Generate an SPOP keyspace notification */ notifyKeyspaceEvent(NOTIFY_SET,"spop",c->argv[1],c->db->id); - server.dirty += count; + server.dirty += (count >= size) ? size : count; /* CASE 1: * The number of requested elements is greater than or equal to @@ -492,7 +492,6 @@ void spopWithCountCommand(client *c) { /* Propagate this command as a DEL operation */ rewriteClientCommandVector(c,2,shared.del,c->argv[1]); signalModifiedKey(c,c->db,c->argv[1]); - server.dirty++; return; } @@ -594,7 +593,6 @@ void spopWithCountCommand(client *c) { decrRefCount(propargv[0]); preventCommandPropagation(c); signalModifiedKey(c,c->db,c->argv[1]); - server.dirty++; } void spopCommand(client *c) { @@ -607,7 +605,7 @@ void spopCommand(client *c) { spopWithCountCommand(c); return; } else if (c->argc > 3) { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } @@ -803,7 +801,7 @@ void srandmemberCommand(client *c) { srandmemberWithCountCommand(c); return; } else if (c->argc > 3) { - addReply(c,shared.syntaxerr); + addReplyErrorObject(c,shared.syntaxerr); return; } |