mirror of https://mirror.osredm.com/root/redis.git
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.
This commit is contained in:
parent
806459f481
commit
b94b714f81
|
@ -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} {
|
||||
|
|
Loading…
Reference in New Issue