]> git.saurik.com Git - redis.git/commitdiff
fixed a bug in rdbLoadObject abount specially encoded objects
authorantirez <antirez@gmail.com>
Sun, 13 Jun 2010 19:09:51 +0000 (21:09 +0200)
committerantirez <antirez@gmail.com>
Sun, 13 Jun 2010 19:09:51 +0000 (21:09 +0200)
redis.c

diff --git a/redis.c b/redis.c
index 295bec049353b09d7a418c02bf467a9bf053e9e2..4f5f68a7c9a1caaf78e119931b928c159553c1cb 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -4250,8 +4250,10 @@ static robj *rdbLoadObject(int type, FILE *fp) {
             /* If we are using a zipmap and there are too big values
              * the object is converted to real hash table encoding. */
             if (o->encoding != REDIS_ENCODING_HT &&
-               (sdslen(key->ptr) > server.hash_max_zipmap_value ||
-                sdslen(val->ptr) > server.hash_max_zipmap_value))
+               ((key->encoding == REDIS_ENCODING_RAW &&
+                sdslen(key->ptr) > server.hash_max_zipmap_value) ||
+                (val->encoding == REDIS_ENCODING_RAW &&
+                sdslen(val->ptr) > server.hash_max_zipmap_value)))
             {
                     convertToRealHash(o);
             }