Fix for ZUNIONSTORE bug when there is an empty set among input sets. Regression test added.

This commit is contained in:
antirez
2011-05-19 17:58:29 +02:00
parent 330c90b018
commit 521ddcce14
2 changed files with 9 additions and 1 deletions

View File

@ -1550,7 +1550,7 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
}
} else if (op == REDIS_OP_UNION) {
for (i = 0; i < setnum; i++) {
if (zuiLength(&src[0]) == 0)
if (zuiLength(&src[i]) == 0)
continue;
while (zuiNext(&src[i],&zval)) {