This is a special version of dbAdd() that is used only when loading * keys from the RDB file: the key is passed as an SDS string that is * retained by the function (and not freed by the caller). * * Moreover this function will not abort if the key is already busy, to * give more control to the caller, nor will signal the key as ready * since it is not useful in this context. * * The functi
| 211 | * ownership of the SDS string, otherwise 0 is returned, and is up to the |
| 212 | * caller to free the SDS string. */ |
| 213 | int dbAddRDBLoad(redisDb *db, sds key, robj *val) { |
| 214 | int retval = dictAdd(db->dict, key, val); |
| 215 | if (retval != DICT_OK) return 0; |
| 216 | if (server.cluster_enabled) slotToKeyAdd(key); |
| 217 | return 1; |
| 218 | } |
| 219 | |
| 220 | /* Overwrite an existing key with a new value. Incrementing the reference |
| 221 | * count of the new value is up to the caller. |
no test coverage detected