Overwrite an existing key with a new value. Incrementing the reference * count of the new value is up to the caller. * This function does not modify the expire time of the existing key. * * The program is aborted if the key was not already present. */
| 361 | * |
| 362 | * The program is aborted if the key was not already present. */ |
| 363 | void dbOverwrite(redisDb *db, robj *key, robj *val, bool fRemoveExpire, dict_iter *pitrExisting) { |
| 364 | redisDb::iter itr; |
| 365 | if (pitrExisting != nullptr) |
| 366 | itr = *pitrExisting; |
| 367 | else |
| 368 | itr = db->find(key); |
| 369 | |
| 370 | serverAssertWithInfo(NULL,key,itr != nullptr); |
| 371 | lookupKeyUpdateObj(itr.val(), LOOKUP_NONE); |
| 372 | db->dbOverwriteCore(itr, szFromObj(key), val, !!g_pserver->fActiveReplica, fRemoveExpire); |
| 373 | } |
| 374 | |
| 375 | /* Insert a key, handling duplicate keys according to fReplace */ |
| 376 | int dbMerge(redisDb *db, sds key, robj *val, int fReplace) |
no test coverage detected