summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2018-07-17 17:50:31 +0200
committerGitHub <noreply@github.com>2018-07-17 17:50:31 +0200
commit4bff45c7a6e79c85764ed0191d0fd215485a47cd (patch)
tree71fadd17b8c43d5ed3a83d6c78e0df460b0ac996
parentafc7e08a20da95d6facf8357a82b7321cb64cfcf (diff)
parent846cf12ae592b8a97c9e932f08b7533902733c17 (diff)
downloadredis-4bff45c7a6e79c85764ed0191d0fd215485a47cd.tar.gz
Merge pull request #5136 from 0xtonyxia/fix-xread-id-parse
Fix xreadgroup with '$' ID.
-rw-r--r--src/t_stream.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index 7b1076b16..05de288e0 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -1351,6 +1351,11 @@ void xreadCommand(client *c) {
}
if (strcmp(c->argv[i]->ptr,"$") == 0) {
+ if (xreadgroup) {
+ addReplyError(c,"The $ ID can be specified only when calling "
+ "XREAD without GROUP option.");
+ goto cleanup;
+ }
if (o) {
stream *s = o->ptr;
ids[id_idx] = s->last_id;
@@ -1360,7 +1365,7 @@ void xreadCommand(client *c) {
}
continue;
} else if (strcmp(c->argv[i]->ptr,">") == 0) {
- if (!xreadgroup || groupname == NULL) {
+ if (!xreadgroup) {
addReplyError(c,"The > ID can be specified only when calling "
"XREADGROUP using the GROUP <group> "
"<consumer> option.");