}
}
- touchWatchedKey(c->db,key);
if (nx) deleteIfVolatile(c->db,key);
retval = dbAdd(c->db,key,val);
if (retval == REDIS_ERR) {
} else {
incrRefCount(val);
}
+ touchWatchedKey(c->db,key);
server.dirty++;
removeExpire(c->db,key);
if (expire) setExpire(c->db,key,time(NULL)+seconds);
if (getGenericCommand(c) == REDIS_ERR) return;
dbReplace(c->db,c->argv[1],c->argv[2]);
incrRefCount(c->argv[2]);
+ touchWatchedKey(c->db,c->argv[1]);
server.dirty++;
removeExpire(c->db,c->argv[1]);
}
dbReplace(c->db,c->argv[j],c->argv[j+1]);
incrRefCount(c->argv[j+1]);
removeExpire(c->db,c->argv[j]);
+ touchWatchedKey(c->db,c->argv[j]);
}
server.dirty += (c->argc-1)/2;
addReply(c, nx ? shared.cone : shared.ok);
value += incr;
o = createStringObjectFromLongLong(value);
dbReplace(c->db,c->argv[1],o);
+ touchWatchedKey(c->db,c->argv[1]);
server.dirty++;
addReply(c,shared.colon);
addReply(c,o);
}
totlen = sdslen(o->ptr);
}
+ touchWatchedKey(c->db,c->argv[1]);
server.dirty++;
addReplySds(c,sdscatprintf(sdsempty(),":%lu\r\n",(unsigned long)totlen));
}
decrRefCount(o);
}
+void strlenCommand(redisClient *c) {
+ robj *o;
+
+ if ((o = lookupKeyReadOrReply(c,c->argv[1],shared.czero)) == NULL ||
+ checkType(c,o,REDIS_STRING)) return;
+ o = getDecodedObject(o);
+ addReplyLongLong(c,sdslen(o->ptr));
+ decrRefCount(o);
+}