Commit d070abe4 authored by antirez's avatar antirez
Browse files

Fix for a possible bug related to ZINTER/UNIONSTORE called with the same...

Fix for a possible bug related to ZINTER/UNIONSTORE called with the same source set more than one time.
parent dd1eefa4
...@@ -1521,7 +1521,10 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) { ...@@ -1521,7 +1521,10 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
score = src[0].weight * zval.score; score = src[0].weight * zval.score;
for (j = 1; j < setnum; j++) { for (j = 1; j < setnum; j++) {
if (zuiFind(&src[j],&zval,&value)) { if (src[j].subject == src[0].subject) {
value = zval.score*src[j].weight;
zunionInterAggregate(&score,value,aggregate);
} else if (zuiFind(&src[j],&zval,&value)) {
value *= src[j].weight; value *= src[j].weight;
zunionInterAggregate(&score,value,aggregate); zunionInterAggregate(&score,value,aggregate);
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment