Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
19e84589
Commit
19e84589
authored
May 16, 2011
by
antirez
Browse files
Merge branch 'unstable'
parents
bfe85f7c
cb16b6c3
Changes
5
Show whitespace changes
Inline
Side-by-side
src/t_list.c
View file @
19e84589
...
@@ -822,7 +822,6 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
...
@@ -822,7 +822,6 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
/* This should remove the first element of the "clients" list. */
/* This should remove the first element of the "clients" list. */
unblockClientWaitingData
(
receiver
);
unblockClientWaitingData
(
receiver
);
redisAssert
(
ln
!=
listFirst
(
clients
));
if
(
dstkey
==
NULL
)
{
if
(
dstkey
==
NULL
)
{
/* BRPOP/BLPOP */
/* BRPOP/BLPOP */
...
...
src/t_set.c
View file @
19e84589
...
@@ -437,6 +437,7 @@ void sinterGenericCommand(redisClient *c, robj **setkeys, unsigned long setnum,
...
@@ -437,6 +437,7 @@ void sinterGenericCommand(redisClient *c, robj **setkeys, unsigned long setnum,
si
=
setTypeInitIterator
(
sets
[
0
]);
si
=
setTypeInitIterator
(
sets
[
0
]);
while
((
encoding
=
setTypeNext
(
si
,
&
eleobj
,
&
intobj
))
!=
-
1
)
{
while
((
encoding
=
setTypeNext
(
si
,
&
eleobj
,
&
intobj
))
!=
-
1
)
{
for
(
j
=
1
;
j
<
setnum
;
j
++
)
{
for
(
j
=
1
;
j
<
setnum
;
j
++
)
{
if
(
sets
[
j
]
==
sets
[
0
])
continue
;
if
(
encoding
==
REDIS_ENCODING_INTSET
)
{
if
(
encoding
==
REDIS_ENCODING_INTSET
)
{
/* intset with intset is simple... and fast */
/* intset with intset is simple... and fast */
if
(
sets
[
j
]
->
encoding
==
REDIS_ENCODING_INTSET
&&
if
(
sets
[
j
]
->
encoding
==
REDIS_ENCODING_INTSET
&&
...
...
src/t_zset.c
View file @
19e84589
...
@@ -1521,7 +1521,12 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
...
@@ -1521,7 +1521,12 @@ 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
))
{
/* 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
;
value
*=
src
[
j
].
weight
;
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
}
else
{
}
else
{
...
@@ -1561,7 +1566,12 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
...
@@ -1561,7 +1566,12 @@ void zunionInterGenericCommand(redisClient *c, robj *dstkey, int op) {
/* Because the inputs are sorted by size, it's only possible
/* Because the inputs are sorted by size, it's only possible
* for sets at larger indices to hold this element. */
* for sets at larger indices to hold this element. */
for
(
j
=
(
i
+
1
);
j
<
setnum
;
j
++
)
{
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
;
value
*=
src
[
j
].
weight
;
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
zunionInterAggregate
(
&
score
,
value
,
aggregate
);
}
}
...
...
tests/integration/replication.tcl
View file @
19e84589
...
@@ -27,6 +27,8 @@ start_server {tags {"repl"}} {
...
@@ -27,6 +27,8 @@ start_server {tags {"repl"}} {
test
{
MASTER and SLAVE consistency with expire
}
{
test
{
MASTER and SLAVE consistency with expire
}
{
createComplexDataset r 50000 useexpire
createComplexDataset r 50000 useexpire
after 4000
;
# Make sure everything expired before taking the digest
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
]}
{
if
{[
r debug digest
]
ne
[
r -1 debug digest
]}
{
set csv1
[
csvdump r
]
set csv1
[
csvdump r
]
set csv2
[
csvdump
{
r -1
}]
set csv2
[
csvdump
{
r -1
}]
...
...
tests/unit/type/zset.tcl
View file @
19e84589
...
@@ -460,6 +460,13 @@ start_server {tags {"zset"}} {
...
@@ -460,6 +460,13 @@ start_server {tags {"zset"}} {
basics ziplist
basics ziplist
basics skiplist
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
}
{
proc stressers
{
encoding
}
{
if
{
$encoding
==
"ziplist"
}
{
if
{
$encoding
==
"ziplist"
}
{
# Little extra to allow proper fuzzing in the sorting stresser
# Little extra to allow proper fuzzing in the sorting stresser
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment