mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Return error to client on wrong type for HMGET
This commit is contained in:
parent
244201f6ba
commit
e584d82fec
@ -310,6 +310,7 @@ void hmgetCommand(redisClient *c) {
|
|||||||
o = lookupKeyRead(c->db,c->argv[1]);
|
o = lookupKeyRead(c->db,c->argv[1]);
|
||||||
if (o != NULL && o->type != REDIS_HASH) {
|
if (o != NULL && o->type != REDIS_HASH) {
|
||||||
addReply(c,shared.wrongtypeerr);
|
addReply(c,shared.wrongtypeerr);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note the check for o != NULL happens inside the loop. This is
|
/* Note the check for o != NULL happens inside the loop. This is
|
||||||
|
@ -140,6 +140,11 @@ start_server {tags {"hash"}} {
|
|||||||
set _ $rv
|
set _ $rv
|
||||||
} {{{} {}} {{} {}} {{} {}}}
|
} {{{} {}} {{} {}} {{} {}}}
|
||||||
|
|
||||||
|
test {HMGET against wrong type} {
|
||||||
|
r set wrongtype somevalue
|
||||||
|
assert_error "*wrong*" {r hmget wrongtype field1 field2}
|
||||||
|
}
|
||||||
|
|
||||||
test {HMGET - small hash} {
|
test {HMGET - small hash} {
|
||||||
set keys {}
|
set keys {}
|
||||||
set vals {}
|
set vals {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user