Z*STORE event fixed: generate del only if resulting sorted set is empty.

This commit is contained in:
antirez 2013-01-29 13:50:01 +01:00
parent e41d1d77e3
commit ad297a1a67

View File

@ -1680,7 +1680,6 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
if (dbDelete(c->db,dstkey)) { if (dbDelete(c->db,dstkey)) {
signalModifiedKey(c->db,dstkey); signalModifiedKey(c->db,dstkey);
notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,"del",dstkey,c->db->id);
touched = 1; touched = 1;
server.dirty++; server.dirty++;
} }
@ -1700,6 +1699,8 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
} else { } else {
decrRefCount(dstobj); decrRefCount(dstobj);
addReply(c,shared.czero); addReply(c,shared.czero);
if (touched)
notifyKeyspaceEvent(REDIS_NOTIFY_GENERIC,"del",dstkey,c->db->id);
} }
zfree(src); zfree(src);
} }