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
6c682e55
Commit
6c682e55
authored
Feb 23, 2011
by
Pieter Noordhuis
Committed by
antirez
Feb 23, 2011
Browse files
Restore argc/argv in EXEC after command is executed
parent
bf45f266
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multi.c
View file @
6c682e55
...
@@ -110,6 +110,10 @@ void execCommand(redisClient *c) {
...
@@ -110,6 +110,10 @@ void execCommand(redisClient *c) {
c
->
argc
=
c
->
mstate
.
commands
[
j
].
argc
;
c
->
argc
=
c
->
mstate
.
commands
[
j
].
argc
;
c
->
argv
=
c
->
mstate
.
commands
[
j
].
argv
;
c
->
argv
=
c
->
mstate
.
commands
[
j
].
argv
;
call
(
c
,
c
->
mstate
.
commands
[
j
].
cmd
);
call
(
c
,
c
->
mstate
.
commands
[
j
].
cmd
);
/* Commands may alter argc/argv, restore mstate. */
c
->
mstate
.
commands
[
j
].
argc
=
c
->
argc
;
c
->
mstate
.
commands
[
j
].
argv
=
c
->
argv
;
}
}
c
->
argv
=
orig_argv
;
c
->
argv
=
orig_argv
;
c
->
argc
=
orig_argc
;
c
->
argc
=
orig_argc
;
...
...
tests/unit/other.tcl
View file @
6c682e55
...
@@ -183,6 +183,13 @@ start_server {tags {"other"}} {
...
@@ -183,6 +183,13 @@ start_server {tags {"other"}} {
set _ $err
set _ $err
}
{
*ERR MULTI*
}
}
{
*ERR MULTI*
}
test
{
MULTI where commands alter argc/argv
}
{
r sadd myset a
r multi
r spop myset
list
[
r exec
]
[
r exists myset
]
}
{
a 0
}
test
{
WATCH inside MULTI is not allowed
}
{
test
{
WATCH inside MULTI is not allowed
}
{
set err
{}
set err
{}
r multi
r multi
...
...
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