Skip to content

Commit

Permalink
XTRIM call streamParseAddOrTrimArgsOrReply use wrong arg xadd. (redis…
Browse files Browse the repository at this point in the history
…#9047)

xtrimCommand call streamParseAddOrTrimArgsOrReply should use xadd==0.

When the syntax is valid, it does not cause any bugs because the params of XADD is superset of XTRIM.
Just XTRIM will not respond with error on invalid syntax. The syntax of XADD will also be accpeted by XTRIM.

(cherry picked from commit 91f3689)
  • Loading branch information
huangzhw authored and oranagra committed Jul 18, 2021
1 parent 280f194 commit 20df843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/t_stream.c
Expand Up @@ -3233,7 +3233,7 @@ void xtrimCommand(client *c) {

/* Argument parsing. */
streamAddTrimArgs parsed_args;
if (streamParseAddOrTrimArgsOrReply(c, &parsed_args, 1) < 0)
if (streamParseAddOrTrimArgsOrReply(c, &parsed_args, 0) < 0)
return; /* streamParseAddOrTrimArgsOrReply already replied. */

/* If the key does not exist, we are ok returning zero, that is, the
Expand Down

0 comments on commit 20df843

Please sign in to comment.