static robj *rdbLoadObject(int type, FILE *fp) {
robj *o;
+ redisLog(REDIS_DEBUG,"LOADING OBJECT %d (at %d)\n",type,ftell(fp));
if (type == REDIS_STRING) {
/* Read string value */
if ((o = rdbLoadStringObject(fp)) == NULL) return NULL;
o = createZsetObject();
zs = o->ptr;
/* Load every single element of the list/set */
+ redisLog(REDIS_DEBUG,"SORTED SET LEN: %zu\n", zsetlen);
while(zsetlen--) {
robj *ele;
double *score = zmalloc(sizeof(double));
if ((ele = rdbLoadStringObject(fp)) == NULL) return NULL;
+ redisLog(REDIS_DEBUG,"ele %s (%d) (%d)\n", (char*)ele->ptr, ftell(fp), zsetlen);
tryObjectEncoding(ele);
if (rdbLoadDoubleValue(fp,score) == -1) return NULL;
+ redisLog(REDIS_DEBUG,"score %.17g\n", *score);
dictAdd(zs->dict,ele,score);
zslInsert(zs->zsl,*score,ele);
incrRefCount(ele); /* added to skiplist */
} else {
redisAssert(0 != 0);
}
+ redisLog(REDIS_DEBUG,"DONE\n");
return o;
}
}
/* Read key */
if ((keyobj = rdbLoadStringObject(fp)) == NULL) goto eoferr;
+ redisLog(REDIS_DEBUG,"KEY: %s\n", (char*)keyobj->ptr);
/* Read value */
if ((o = rdbLoadObject(type,fp)) == NULL) goto eoferr;
/* Add the new object in the hash table */
addReply(c,shared.nullbulk);
return;
} else {
+ if (o->type != REDIS_HASH) {
+ addReply(c,shared.wrongtypeerr);
+ return;
+ }
+
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
unsigned char *zm = o->ptr;
unsigned char *val;