diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2018-07-17 17:50:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-17 17:50:31 +0200 |
commit | 4bff45c7a6e79c85764ed0191d0fd215485a47cd (patch) | |
tree | 71fadd17b8c43d5ed3a83d6c78e0df460b0ac996 | |
parent | afc7e08a20da95d6facf8357a82b7321cb64cfcf (diff) | |
parent | 846cf12ae592b8a97c9e932f08b7533902733c17 (diff) | |
download | redis-4bff45c7a6e79c85764ed0191d0fd215485a47cd.tar.gz |
Merge pull request #5136 from 0xtonyxia/fix-xread-id-parse
Fix xreadgroup with '$' ID.
-rw-r--r-- | src/t_stream.c | 7 |
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."); |