MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dbAdd

Function dbAdd

app/redis-6.2.6/src/db.c:193–200  ·  view source on GitHub ↗

Add the key to the DB. It's up to the caller to increment the reference * counter of the value if needed. * * The program is aborted if the key already exists. */

Source from the content-addressed store, hash-verified

191 *
192 * The program is aborted if the key already exists. */
193void dbAdd(redisDb *db, robj *key, robj *val) {
194 sds copy = sdsdup(key->ptr);
195 int retval = dictAdd(db->dict, copy, val);
196
197 serverAssertWithInfo(NULL,key,retval == DICT_OK);
198 signalKeyAsReady(db, key, val->type);
199 if (server.cluster_enabled) slotToKeyAdd(key->ptr);
200}
201
202/* This is a special version of dbAdd() that is used only when loading
203 * keys from the RDB file: the key is passed as an SDS string that is

Callers 15

setrangeCommandFunction · 0.85
incrDecrCommandFunction · 0.85
incrbyfloatCommandFunction · 0.85
appendCommandFunction · 0.85
pfaddCommandFunction · 0.85
pfmergeCommandFunction · 0.85
genericSetKeyFunction · 0.85
renameGenericCommandFunction · 0.85
moveCommandFunction · 0.85
copyCommandFunction · 0.85

Calls 4

sdsdupFunction · 0.85
signalKeyAsReadyFunction · 0.85
slotToKeyAddFunction · 0.85
dictAddFunction · 0.70

Tested by

no test coverage detected