Skip to content

Commit

Permalink
Fix INFO commandstats reporting when argv is rewritten.
Browse files Browse the repository at this point in the history
We want to report the original command in the stats, for example GEOADD,
even when what is actually executed is the ZADD implementation.
  • Loading branch information
antirez committed May 2, 2016
1 parent 76b22e3 commit ba9154d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/scripting.c
Expand Up @@ -463,7 +463,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
luaPushError(lua,"Unknown Redis command called from Lua script");
goto cleanup;
}
c->cmd = cmd;
c->cmd = c->lastcmd = cmd;

/* There are commands that are not allowed inside scripts. */
if (cmd->flags & CMD_NOSCRIPT) {
Expand Down
4 changes: 2 additions & 2 deletions src/server.c
Expand Up @@ -2245,8 +2245,8 @@ void call(client *c, int flags) {
slowlogPushEntryIfNeeded(c->argv,c->argc,duration);
}
if (flags & CMD_CALL_STATS) {
c->cmd->microseconds += duration;
c->cmd->calls++;
c->lastcmd->microseconds += duration;
c->lastcmd->calls++;
}

/* Propagate the command into the AOF and replication link */
Expand Down

0 comments on commit ba9154d

Please sign in to comment.