Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
cb9a5a78
Commit
cb9a5a78
authored
May 15, 2015
by
Salvatore Sanfilippo
Browse files
Merge pull request #2529 from gnethercutt/issue_2517
Issue #2517, smove contract violation
parents
7f7ddbba
626b4f69
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/t_set.c
View file @
cb9a5a78
...
@@ -343,7 +343,10 @@ void smoveCommand(redisClient *c) {
...
@@ -343,7 +343,10 @@ void smoveCommand(redisClient *c) {
/* If srcset and dstset are equal, SMOVE is a no-op */
/* If srcset and dstset are equal, SMOVE is a no-op */
if
(
srcset
==
dstset
)
{
if
(
srcset
==
dstset
)
{
addReply
(
c
,
shared
.
cone
);
if
(
setTypeIsMember
(
srcset
,
ele
))
addReply
(
c
,
shared
.
cone
);
else
addReply
(
c
,
shared
.
czero
);
return
;
return
;
}
}
...
...
tests/unit/type/set.tcl
View file @
cb9a5a78
...
@@ -519,6 +519,7 @@ start_server {
...
@@ -519,6 +519,7 @@ start_server {
test
"SMOVE non existing key"
{
test
"SMOVE non existing key"
{
setup_move
setup_move
assert_equal 0
[
r smove myset1 myset2 foo
]
assert_equal 0
[
r smove myset1 myset2 foo
]
assert_equal 0
[
r smove myset1 myset1 foo
]
assert_equal
{
1 a b
}
[
lsort
[
r smembers myset1
]]
assert_equal
{
1 a b
}
[
lsort
[
r smembers myset1
]]
assert_equal
{
2 3 4
}
[
lsort
[
r smembers myset2
]]
assert_equal
{
2 3 4
}
[
lsort
[
r smembers myset2
]]
}
}
...
...
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