Streams: lookupKey[Read->Write]OrReply in xdel and xtrim

This commit is contained in:
zhaozhao.zz 2018-06-11 00:14:17 +08:00
parent be899b824e
commit cc81c6f1d3

View File

@ -2056,7 +2056,7 @@ void xclaimCommand(client *c) {
void xdelCommand(client *c) { void xdelCommand(client *c) {
robj *o; 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; || checkType(c,o,OBJ_STREAM)) return;
stream *s = o->ptr; 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 /* If the key does not exist, we are ok returning zero, that is, the
* number of elements removed from the stream. */ * 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; || checkType(c,o,OBJ_STREAM)) return;
stream *s = o->ptr; stream *s = o->ptr;