We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 244201f commit e584d82Copy full SHA for e584d82
src/t_hash.c
@@ -310,6 +310,7 @@ void hmgetCommand(redisClient *c) {
310
o = lookupKeyRead(c->db,c->argv[1]);
311
if (o != NULL && o->type != REDIS_HASH) {
312
addReply(c,shared.wrongtypeerr);
313
+ return;
314
}
315
316
/* Note the check for o != NULL happens inside the loop. This is
tests/unit/type/hash.tcl
@@ -140,6 +140,11 @@ start_server {tags {"hash"}} {
140
set _ $rv
141
} {{{} {}} {{} {}} {{} {}}}
142
143
+ test {HMGET against wrong type} {
144
+ r set wrongtype somevalue
145
+ assert_error "*wrong*" {r hmget wrongtype field1 field2}
146
+ }
147
+
148
test {HMGET - small hash} {
149
set keys {}
150
set vals {}
0 commit comments