summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-03-06 12:55:41 +0100
committerantirez <antirez@gmail.com>2018-03-15 12:54:10 +0100
commit8d8755c7b56069646ab0bd02e46652bfee19fcd1 (patch)
treee78193af8f1655fa3eade5013dd544dbb7dfaacf
parentd4f81ebdba7eadcb89b91377fb9091ef7e0513b7 (diff)
downloadredis-8d8755c7b56069646ab0bd02e46652bfee19fcd1.tar.gz
CG: throw an error if XREADGROUP is used without GROUP.
-rw-r--r--src/t_stream.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index a2404244c..e2908d2cf 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -1131,6 +1131,13 @@ void xreadCommand(client *c) {
return;
}
+ /* If the user specified XREADGROUP then it must also
+ * provide the GROUP option. */
+ if (xreadgroup && groupname == NULL) {
+ addReplyError(c,"Missing GROUP option for XREADGROUP");
+ return;
+ }
+
/* Parse the IDs and resolve the group name. */
if (streams_count > STREAMID_STATIC_VECTOR_LEN)
ids = zmalloc(sizeof(streamID)*streams_count);