From cc81c6f1d3905bd8ddfd0198aefcf3abc3d4d068 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Mon, 11 Jun 2018 00:14:17 +0800 Subject: [PATCH] Streams: lookupKey[Read->Write]OrReply in xdel and xtrim --- src/t_stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/t_stream.c b/src/t_stream.c index 075386dd..eb111303 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -2056,7 +2056,7 @@ void xclaimCommand(client *c) { void xdelCommand(client *c) { robj *o; - if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL + if ((o = lookupKeyWriteOrReply(c,c->argv[1],shared.czero)) == NULL || checkType(c,o,OBJ_STREAM)) return; stream *s = o->ptr; @@ -2097,7 +2097,7 @@ void xtrimCommand(client *c) { /* If the key does not exist, we are ok returning zero, that is, the * number of elements removed from the stream. */ - if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL + if ((o = lookupKeyWriteOrReply(c,c->argv[1],shared.czero)) == NULL || checkType(c,o,OBJ_STREAM)) return; stream *s = o->ptr;