From 20df843537482d72b4545760e2a7543e435b87a5 Mon Sep 17 00:00:00 2001 From: Huang Zhw Date: Sun, 6 Jun 2021 20:09:06 +0800 Subject: [PATCH] XTRIM call streamParseAddOrTrimArgsOrReply use wrong arg xadd. (#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 91f3689bf5dc4ce3cf00d9d957b9677b362a205e) --- src/t_stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_stream.c b/src/t_stream.c index 1b2fe3262d7a..c7be94d6b994 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -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