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
61e25476
Commit
61e25476
authored
Feb 23, 2011
by
Pieter Noordhuis
Browse files
Restore argc/argv in EXEC after command is executed
parent
595b5974
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/multi.c
View file @
61e25476
...
...
@@ -110,6 +110,10 @@ void execCommand(redisClient *c) {
c
->
argc
=
c
->
mstate
.
commands
[
j
].
argc
;
c
->
argv
=
c
->
mstate
.
commands
[
j
].
argv
;
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
->
argc
=
orig_argc
;
...
...
tests/unit/other.tcl
View file @
61e25476
...
...
@@ -174,6 +174,13 @@ start_server {tags {"other"}} {
set _ $err
}
{
*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
}
{
set err
{}
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