Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'unstable'

  • Loading branch information...
commit 19e84589304256f0581b056133c9cae6ea1e011b 2 parents bfe85f7 + cb16b6c
@antirez antirez authored
View
1  src/t_list.c
@@ -822,7 +822,6 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
/* This should remove the first element of the "clients" list. */
unblockClientWaitingData(receiver);
- redisAssert(ln != listFirst(clients));
if (dstkey == NULL) {
/* BRPOP/BLPOP */
View
1  src/t_set.c
@@ -437,6 +437,7 @@ void sinterGenericCommand(redisClient *c, robj **setkeys, unsigned long setnum,
si = setTypeInitIterator(sets[0]);
while((encoding = setTypeNext(si,&eleobj,&intobj)) != -1) {
for (j = 1; j < setnum; j++) {
+ if (sets[j] == sets[0]) continue;
if (encoding == REDIS_ENCODING_INTSET) {
/* intset with intset is simple... and fast */
if (sets[j]->encoding == REDIS_ENCODING_INTSET &&
View
14 src/t_zset.c
@@ -1521,7 +1521,12 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
score = src[0].weight * zval.score;
for (j = 1; j < setnum; j++) {
- if (zuiFind(&src[j],&zval,&value)) {
+ /* It is not safe to access the hash we zset we are
+ * iterating, so explicitly check for equal object. */
+ 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;
zunionInterAggregate(&score,value,aggregate);
} else {
@@ -1561,7 +1566,12 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
/* Because the inputs are sorted by size, it's only possible
* for sets at larger indices to hold this element. */
for (j = (i+1); j < setnum; j++) {
- if (zuiFind(&src[j],&zval,&value)) {
+ /* It is not safe to access the hash we zset we are
+ * iterating, so explicitly check for equal object. */
+ if(src[j].subject == src[i].subject) {
+ value = zval.score*src[j].weight;
+ zunionInterAggregate(&score,value,aggregate);
+ } else if (zuiFind(&src[j],&zval,&value)) {
value *= src[j].weight;
zunionInterAggregate(&score,value,aggregate);
}
View
2  tests/integration/replication.tcl
@@ -27,6 +27,8 @@ start_server {tags {"repl"}} {
test {MASTER and SLAVE consistency with expire} {
createComplexDataset r 50000 useexpire
after 4000 ;# Make sure everything expired before taking the digest
+ r keys * ;# Force DEL syntesizing to slave
+ after 1000 ;# Wait another second. Now everything should be file.
if {[r debug digest] ne [r -1 debug digest]} {
set csv1 [csvdump r]
set csv2 [csvdump {r -1}]
View
7 tests/unit/type/zset.tcl
@@ -460,6 +460,13 @@ start_server {tags {"zset"}} {
basics ziplist
basics skiplist
+ test {ZINTERSTORE regression with two sets, intset+hashtable} {
+ r del seta setb setc
+ r sadd set1 a
+ r sadd set2 10
+ r zinterstore set3 2 set1 set2
+ } {0}
+
proc stressers {encoding} {
if {$encoding == "ziplist"} {
# Little extra to allow proper fuzzing in the sorting stresser
Please sign in to comment.
Something went wrong with that request. Please try again.