Low level key lookup API, not actually called directly from commands * implementations that should instead rely on lookupKeyRead(), * lookupKeyWrite() and lookupKeyReadWithFlags(). */
| 107 | * implementations that should instead rely on lookupKeyRead(), |
| 108 | * lookupKeyWrite() and lookupKeyReadWithFlags(). */ |
| 109 | static robj* lookupKey(redisDb *db, robj *key, int flags) { |
| 110 | auto itr = db->find(key); |
| 111 | if (itr) { |
| 112 | robj *val = itr.val(); |
| 113 | lookupKeyUpdateObj(val, flags); |
| 114 | if (flags & LOOKUP_UPDATEMVCC) { |
| 115 | setMvccTstamp(val, getMvccTstamp()); |
| 116 | db->trackkey(key, true /* fUpdate */); |
| 117 | } |
| 118 | return val; |
| 119 | } else { |
| 120 | return NULL; |
| 121 | } |
| 122 | } |
| 123 | static robj_roptr lookupKeyConst(redisDb *db, robj *key, int flags) { |
| 124 | serverAssert((flags & LOOKUP_UPDATEMVCC) == 0); |
| 125 | robj_roptr val; |
no test coverage detected