Unverified Commit b94b714f authored by debing.sun's avatar debing.sun Committed by GitHub
Browse files

Fix error message for XREAD command with wrong parameter (#13474)

Fixed a missing from #13117.
When the number of streams is incorrect, the error message for `XREAD`
needs to include the '+' symbol.
parent 806459f4
......@@ -2189,9 +2189,9 @@ void xreadCommand(client *c) {
streams_arg = i+1;
streams_count = (c->argc-streams_arg);
if ((streams_count % 2) != 0) {
char symbol = xreadgroup ? '>' : '$';
const char *symbol = xreadgroup ? "ID or '>'" : "ID, '+', or '$'";
addReplyErrorFormat(c,"Unbalanced '%s' list of streams: "
"for each stream key an ID or '%c' must be "
"for each stream key an %s must be "
"specified.", c->cmd->fullname,symbol);
return;
}
......
......@@ -319,7 +319,7 @@ start_server {
r XADD mystream 666 f v
r XGROUP CREATE mystream mygroup $
assert_error "ERR Unbalanced 'xreadgroup' list of streams: for each stream key an ID or '>' must be specified." {r XREADGROUP GROUP mygroup Alice COUNT 1 STREAMS mystream }
assert_error "ERR Unbalanced 'xread' list of streams: for each stream key an ID or '$' must be specified." {r XREAD COUNT 1 STREAMS mystream }
assert_error "ERR Unbalanced 'xread' list of streams: for each stream key an ID, '+', or '$' must be specified." {r XREAD COUNT 1 STREAMS mystream }
}
test {Blocking XREAD: key deleted} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment