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
889b0174
Commit
889b0174
authored
Mar 26, 2013
by
antirez
Browse files
Transactions: use discardTransaction() in EXEC implementation.
parent
d1369c3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/multi.c
View file @
889b0174
...
@@ -131,10 +131,7 @@ void execCommand(redisClient *c) {
...
@@ -131,10 +131,7 @@ void execCommand(redisClient *c) {
if
(
c
->
flags
&
(
REDIS_DIRTY_CAS
|
REDIS_DIRTY_EXEC
))
{
if
(
c
->
flags
&
(
REDIS_DIRTY_CAS
|
REDIS_DIRTY_EXEC
))
{
addReply
(
c
,
c
->
flags
&
REDIS_DIRTY_EXEC
?
shared
.
execaborterr
:
addReply
(
c
,
c
->
flags
&
REDIS_DIRTY_EXEC
?
shared
.
execaborterr
:
shared
.
nullmultibulk
);
shared
.
nullmultibulk
);
freeClientMultiState
(
c
);
discardTransaction
(
c
);
initClientMultiState
(
c
);
c
->
flags
&=
~
(
REDIS_MULTI
|
REDIS_DIRTY_CAS
|
REDIS_DIRTY_EXEC
);
unwatchAllKeys
(
c
);
goto
handle_monitor
;
goto
handle_monitor
;
}
}
...
@@ -164,9 +161,7 @@ void execCommand(redisClient *c) {
...
@@ -164,9 +161,7 @@ void execCommand(redisClient *c) {
c
->
argv
=
orig_argv
;
c
->
argv
=
orig_argv
;
c
->
argc
=
orig_argc
;
c
->
argc
=
orig_argc
;
c
->
cmd
=
orig_cmd
;
c
->
cmd
=
orig_cmd
;
freeClientMultiState
(
c
);
discardTransaction
(
c
);
initClientMultiState
(
c
);
c
->
flags
&=
~
(
REDIS_MULTI
|
REDIS_DIRTY_CAS
|
REDIS_DIRTY_EXEC
);
/* Make sure the EXEC command is always replicated / AOF, since we
/* Make sure the EXEC command is always replicated / AOF, since we
* always send the MULTI command (we can't know beforehand if the
* always send the MULTI command (we can't know beforehand if the
* next operations will contain at least a modification to the DB). */
* next operations will contain at least a modification to the DB). */
...
...
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