diff options
author | antirez <antirez@gmail.com> | 2010-10-27 16:37:34 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2010-10-27 16:37:34 +0200 |
commit | fac62d47e7e7a2da7013da766afeefa52b0df865 (patch) | |
tree | ec73cf90a5487e1b8ac4f03f50ee9229bdfce141 | |
parent | ff29ca1c464e7d79748e840c2b74e26ca8eae144 (diff) | |
parent | f5936fa1c2e0ee4d25ba0c1a9944ebe29a6eee4b (diff) | |
download | redis-fac62d47e7e7a2da7013da766afeefa52b0df865.tar.gz |
Merge remote branch 'pietern/2.0.0-hmget-fix' into 2.0.0
-rw-r--r-- | redis.c | 1 | ||||
-rw-r--r-- | tests/unit/type/hash.tcl | 5 |
2 files changed, 6 insertions, 0 deletions
@@ -6707,6 +6707,7 @@ static void hmgetCommand(redisClient *c) { o = lookupKeyRead(c->db,c->argv[1]); if (o != NULL && o->type != REDIS_HASH) { addReply(c,shared.wrongtypeerr); + return; } /* Note the check for o != NULL happens inside the loop. This is diff --git a/tests/unit/type/hash.tcl b/tests/unit/type/hash.tcl index ef49a27d8..451438dba 100644 --- a/tests/unit/type/hash.tcl +++ b/tests/unit/type/hash.tcl @@ -140,6 +140,11 @@ start_server {tags {"hash"}} { set _ $rv } {{{} {}} {{} {}} {{} {}}} + test {HMGET against wrong type} { + r set wrongtype somevalue + assert_error "*wrong*" {r hmget wrongtype field1 field2} + } + test {HMGET - small hash} { set keys {} set vals {} |