mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 15:21:03 +00:00
use raw strings when loading a hash from the rdb into a zipmap
This commit is contained in:
parent
f6475c7250
commit
a8dca69bb3
10
redis.c
10
redis.c
@ -4258,10 +4258,16 @@ static robj *rdbLoadObject(int type, FILE *fp) {
|
|||||||
|
|
||||||
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
|
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
|
||||||
unsigned char *zm = o->ptr;
|
unsigned char *zm = o->ptr;
|
||||||
|
robj *deckey, *decval;
|
||||||
|
|
||||||
zm = zipmapSet(zm,key->ptr,sdslen(key->ptr),
|
/* We need raw string objects to add them to the zipmap */
|
||||||
val->ptr,sdslen(val->ptr),NULL);
|
deckey = getDecodedObject(key);
|
||||||
|
decval = getDecodedObject(val);
|
||||||
|
zm = zipmapSet(zm,deckey->ptr,sdslen(deckey->ptr),
|
||||||
|
decval->ptr,sdslen(decval->ptr),NULL);
|
||||||
o->ptr = zm;
|
o->ptr = zm;
|
||||||
|
decrRefCount(deckey);
|
||||||
|
decrRefCount(decval);
|
||||||
decrRefCount(key);
|
decrRefCount(key);
|
||||||
decrRefCount(val);
|
decrRefCount(val);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user