- /* printf("lookup '%s' => %p\n", keyname.buf,de); */
- return lookupKeyRead(db,&keyobj);
+ /* Lookup substituted key */
+ initStaticStringObject(keyobj,((char*)&keyname)+(sizeof(long)*2));
+ o = lookupKeyRead(db,&keyobj);
+
+ /* Retrieve value from hash by the field name */
+ if (o != NULL && fieldlen > 0) {
+ if (o->type != REDIS_HASH || fieldname.len < 1) {
+ return NULL;
+ }
+ initStaticStringObject(fieldobj,((char*)&fieldname)+(sizeof(long)*2));
+ o = hashGet(o, &fieldobj);
+ }
+
+ return o;