summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhaozhao.zz <zhaozhao.zz@alibaba-inc.com>2019-11-22 16:20:27 +0800
committerzhaozhao.zz <zhaozhao.zz@alibaba-inc.com>2019-11-22 16:20:30 +0800
commit2c970532dc47e68efee55082718502e4fa591c7d (patch)
tree533e5835b34870bc8b7ece84ee3dd7466722e358
parentc73d70fb4654f1758c73e4d23e278e1c01575ffa (diff)
downloadredis-2c970532dc47e68efee55082718502e4fa591c7d.tar.gz
Propagation: flag module client as CLIENT_MULTI if needed
in case of nested MULTI/EXEC
-rw-r--r--src/module.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index b6a87ab27..177864497 100644
--- a/src/module.c
+++ b/src/module.c
@@ -3243,6 +3243,11 @@ RedisModuleCallReply *RM_Call(RedisModuleCtx *ctx, const char *cmdname, const ch
* a Lua script in the context of AOF and slaves. */
if (replicate) moduleReplicateMultiIfNeeded(ctx);
+ if (ctx->client->flags & CLIENT_MULTI ||
+ ctx->flags & REDISMODULE_CTX_MULTI_EMITTED) {
+ c->flags |= CLIENT_MULTI;
+ }
+
/* Run the command */
int call_flags = CMD_CALL_SLOWLOG | CMD_CALL_STATS;
if (replicate) {