webdis
webdis copied to clipboard
RAW output format skips null elements in MGET
If we issue an MGET command asking for a key that does not exist we will not get anything for it. For example, let's say that we did the following commands: FLUSHALL SET k1 a SET k2 b
and then we do an MGET command to webdis:
MGET/k1/c/k2.raw
the response is following:
*3 $1 a $1 b
as we see we don't get anything for "c" key which hasn't been set therefore we cannot distinguish which key is missing. According to redis protocol described in:
http://redis.io/topics/protocol
for a null key we should be getting "$-1"
so our output for the previous command should look like:
*3 $1 a $-1 $1 b