Moved most static strings into the shared structure (#8411)
Moved most static strings into the shared structure
This commit is contained in:
parent
4554a49d32
commit
899c85ae67
@ -2253,7 +2253,7 @@ void authCommand(client *c) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
username = createStringObject("default",7);
|
username = shared.default_username;
|
||||||
password = c->argv[1];
|
password = c->argv[1];
|
||||||
} else {
|
} else {
|
||||||
username = c->argv[1];
|
username = c->argv[1];
|
||||||
@ -2265,9 +2265,5 @@ void authCommand(client *c) {
|
|||||||
} else {
|
} else {
|
||||||
addReplyError(c,"-WRONGPASS invalid username-password pair or user is disabled.");
|
addReplyError(c,"-WRONGPASS invalid username-password pair or user is disabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free the "default" string object we created for the two
|
|
||||||
* arguments form. */
|
|
||||||
if (c->argc == 2) decrRefCount(username);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,11 +588,10 @@ sds catAppendOnlyExpireAtCommand(sds buf, struct redisCommand *cmd, robj *key, r
|
|||||||
}
|
}
|
||||||
decrRefCount(seconds);
|
decrRefCount(seconds);
|
||||||
|
|
||||||
argv[0] = createStringObject("PEXPIREAT",9);
|
argv[0] = shared.pexpireat;
|
||||||
argv[1] = key;
|
argv[1] = key;
|
||||||
argv[2] = createStringObjectFromLongLong(when);
|
argv[2] = createStringObjectFromLongLong(when);
|
||||||
buf = catAppendOnlyGenericCommand(buf, 3, argv);
|
buf = catAppendOnlyGenericCommand(buf, 3, argv);
|
||||||
decrRefCount(argv[0]);
|
|
||||||
decrRefCount(argv[2]);
|
decrRefCount(argv[2]);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
17
src/object.c
17
src/object.c
@ -384,23 +384,6 @@ void decrRefCountVoid(void *o) {
|
|||||||
decrRefCount(o);
|
decrRefCount(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function set the ref count to zero without freeing the object.
|
|
||||||
* It is useful in order to pass a new object to functions incrementing
|
|
||||||
* the ref count of the received object. Example:
|
|
||||||
*
|
|
||||||
* functionThatWillIncrementRefCount(resetRefCount(CreateObject(...)));
|
|
||||||
*
|
|
||||||
* Otherwise you need to resort to the less elegant pattern:
|
|
||||||
*
|
|
||||||
* *obj = createObject(...);
|
|
||||||
* functionThatWillIncrementRefCount(obj);
|
|
||||||
* decrRefCount(obj);
|
|
||||||
*/
|
|
||||||
robj *resetRefCount(robj *obj) {
|
|
||||||
obj->refcount = 0;
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
int checkType(client *c, robj *o, int type) {
|
int checkType(client *c, robj *o, int type) {
|
||||||
/* A NULL is considered an empty key */
|
/* A NULL is considered an empty key */
|
||||||
if (o && o->type != type) {
|
if (o && o->type != type) {
|
||||||
|
@ -3333,10 +3333,9 @@ void replicationCron(void) {
|
|||||||
checkClientPauseTimeoutAndReturnIfPaused();
|
checkClientPauseTimeoutAndReturnIfPaused();
|
||||||
|
|
||||||
if (!manual_failover_in_progress) {
|
if (!manual_failover_in_progress) {
|
||||||
ping_argv[0] = createStringObject("PING",4);
|
ping_argv[0] = shared.ping;
|
||||||
replicationFeedSlaves(server.slaves, server.slaveseldb,
|
replicationFeedSlaves(server.slaves, server.slaveseldb,
|
||||||
ping_argv, 1);
|
ping_argv, 1);
|
||||||
decrRefCount(ping_argv[0]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1668,12 +1668,11 @@ void evalGenericCommand(client *c, int evalsha) {
|
|||||||
* or just running a CPU costly read-only script on the slaves. */
|
* or just running a CPU costly read-only script on the slaves. */
|
||||||
if (server.dirty == initial_server_dirty) {
|
if (server.dirty == initial_server_dirty) {
|
||||||
rewriteClientCommandVector(c,3,
|
rewriteClientCommandVector(c,3,
|
||||||
resetRefCount(createStringObject("SCRIPT",6)),
|
shared.script,
|
||||||
resetRefCount(createStringObject("LOAD",4)),
|
shared.load,
|
||||||
script);
|
script);
|
||||||
} else {
|
} else {
|
||||||
rewriteClientCommandArgument(c,0,
|
rewriteClientCommandArgument(c,0,shared.eval);
|
||||||
resetRefCount(createStringObject("EVAL",4)));
|
|
||||||
rewriteClientCommandArgument(c,1,script);
|
rewriteClientCommandArgument(c,1,script);
|
||||||
}
|
}
|
||||||
forceCommandPropagation(c,PROPAGATE_REPL|PROPAGATE_AOF);
|
forceCommandPropagation(c,PROPAGATE_REPL|PROPAGATE_AOF);
|
||||||
|
40
src/server.c
40
src/server.c
@ -2418,13 +2418,10 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
|
|||||||
if (server.get_ack_from_slaves && !checkClientPauseTimeoutAndReturnIfPaused()) {
|
if (server.get_ack_from_slaves && !checkClientPauseTimeoutAndReturnIfPaused()) {
|
||||||
robj *argv[3];
|
robj *argv[3];
|
||||||
|
|
||||||
argv[0] = createStringObject("REPLCONF",8);
|
argv[0] = shared.replconf;
|
||||||
argv[1] = createStringObject("GETACK",6);
|
argv[1] = shared.getack;
|
||||||
argv[2] = createStringObject("*",1); /* Not used argument. */
|
argv[2] = shared.special_asterick; /* Not used argument. */
|
||||||
replicationFeedSlaves(server.slaves, server.slaveseldb, argv, 3);
|
replicationFeedSlaves(server.slaves, server.slaveseldb, argv, 3);
|
||||||
decrRefCount(argv[0]);
|
|
||||||
decrRefCount(argv[1]);
|
|
||||||
decrRefCount(argv[2]);
|
|
||||||
server.get_ack_from_slaves = 0;
|
server.get_ack_from_slaves = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2565,6 +2562,8 @@ void createSharedObjects(void) {
|
|||||||
shared.unsubscribebulk = createStringObject("$11\r\nunsubscribe\r\n",18);
|
shared.unsubscribebulk = createStringObject("$11\r\nunsubscribe\r\n",18);
|
||||||
shared.psubscribebulk = createStringObject("$10\r\npsubscribe\r\n",17);
|
shared.psubscribebulk = createStringObject("$10\r\npsubscribe\r\n",17);
|
||||||
shared.punsubscribebulk = createStringObject("$12\r\npunsubscribe\r\n",19);
|
shared.punsubscribebulk = createStringObject("$12\r\npunsubscribe\r\n",19);
|
||||||
|
|
||||||
|
/* Shared command names */
|
||||||
shared.del = createStringObject("DEL",3);
|
shared.del = createStringObject("DEL",3);
|
||||||
shared.unlink = createStringObject("UNLINK",6);
|
shared.unlink = createStringObject("UNLINK",6);
|
||||||
shared.rpop = createStringObject("RPOP",4);
|
shared.rpop = createStringObject("RPOP",4);
|
||||||
@ -2577,15 +2576,38 @@ void createSharedObjects(void) {
|
|||||||
shared.zpopmax = createStringObject("ZPOPMAX",7);
|
shared.zpopmax = createStringObject("ZPOPMAX",7);
|
||||||
shared.multi = createStringObject("MULTI",5);
|
shared.multi = createStringObject("MULTI",5);
|
||||||
shared.exec = createStringObject("EXEC",4);
|
shared.exec = createStringObject("EXEC",4);
|
||||||
/* Used in the LMOVE/BLMOVE commands */
|
shared.hset = createStringObject("HSET",4);
|
||||||
shared.left = createStringObject("left",4);
|
shared.srem = createStringObject("SREM",4);
|
||||||
shared.right = createStringObject("right",5);
|
shared.xgroup = createStringObject("XGROUP",6);
|
||||||
|
shared.xclaim = createStringObject("XCLAIM",6);
|
||||||
|
shared.script = createStringObject("SCRIPT",6);
|
||||||
|
shared.replconf = createStringObject("REPLCONF",8);
|
||||||
shared.pexpireat = createStringObject("PEXPIREAT",9);
|
shared.pexpireat = createStringObject("PEXPIREAT",9);
|
||||||
shared.pexpire = createStringObject("PEXPIRE",7);
|
shared.pexpire = createStringObject("PEXPIRE",7);
|
||||||
shared.persist = createStringObject("PERSIST",7);
|
shared.persist = createStringObject("PERSIST",7);
|
||||||
shared.set = createStringObject("SET",3);
|
shared.set = createStringObject("SET",3);
|
||||||
|
shared.eval = createStringObject("EVAL",4);
|
||||||
|
|
||||||
|
/* Shared command argument */
|
||||||
|
shared.left = createStringObject("left",4);
|
||||||
|
shared.right = createStringObject("right",5);
|
||||||
shared.pxat = createStringObject("PXAT", 4);
|
shared.pxat = createStringObject("PXAT", 4);
|
||||||
shared.px = createStringObject("PX",2);
|
shared.px = createStringObject("PX",2);
|
||||||
|
shared.time = createStringObject("TIME",4);
|
||||||
|
shared.retrycount = createStringObject("RETRYCOUNT",10);
|
||||||
|
shared.force = createStringObject("FORCE",5);
|
||||||
|
shared.justid = createStringObject("JUSTID",6);
|
||||||
|
shared.lastid = createStringObject("LASTID",6);
|
||||||
|
shared.default_username = createStringObject("default",7);
|
||||||
|
shared.ping = createStringObject("ping",7);
|
||||||
|
shared.setid = createStringObject("SETID",5);
|
||||||
|
shared.keepttl = createStringObject("KEEPTTL",7);
|
||||||
|
shared.load = createStringObject("LOAD",4);
|
||||||
|
shared.createconsumer = createStringObject("CREATECONSUMER",14);
|
||||||
|
shared.getack = createStringObject("GETACK",6);
|
||||||
|
shared.special_asterick = createStringObject("*",1);
|
||||||
|
shared.special_equals = createStringObject("=",1);
|
||||||
|
|
||||||
for (j = 0; j < OBJ_SHARED_INTEGERS; j++) {
|
for (j = 0; j < OBJ_SHARED_INTEGERS; j++) {
|
||||||
shared.integers[j] =
|
shared.integers[j] =
|
||||||
makeObjectShared(createObject(OBJ_STRING,(void*)(long)j));
|
makeObjectShared(createObject(OBJ_STRING,(void*)(long)j));
|
||||||
|
@ -976,8 +976,11 @@ struct sharedObjectsStruct {
|
|||||||
*busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
*busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
||||||
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *unlink,
|
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *unlink,
|
||||||
*rpop, *lpop, *lpush, *rpoplpush, *lmove, *blmove, *zpopmin, *zpopmax,
|
*rpop, *lpop, *lpush, *rpoplpush, *lmove, *blmove, *zpopmin, *zpopmax,
|
||||||
*emptyscan, *multi, *exec, *left, *right, *persist, *set, *pexpireat,
|
*emptyscan, *multi, *exec, *left, *right, *hset, *srem, *xgroup, *xclaim,
|
||||||
*pexpire, *pxat, *px,
|
*script, *replconf, *eval, *persist, *set, *pexpireat, *pexpire,
|
||||||
|
*time, *pxat, *px, *retrycount, *force, *justid,
|
||||||
|
*lastid, *ping, *setid, *keepttl, *load, *createconsumer,
|
||||||
|
*getack, *special_asterick, *special_equals, *default_username,
|
||||||
*select[PROTO_SHARED_SELECT_CMDS],
|
*select[PROTO_SHARED_SELECT_CMDS],
|
||||||
*integers[OBJ_SHARED_INTEGERS],
|
*integers[OBJ_SHARED_INTEGERS],
|
||||||
*mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
|
*mbulkhdr[OBJ_SHARED_BULKHDR_LEN], /* "*<value>\r\n" */
|
||||||
|
@ -759,11 +759,9 @@ void hincrbyfloatCommand(client *c) {
|
|||||||
/* Always replicate HINCRBYFLOAT as an HSET command with the final value
|
/* Always replicate HINCRBYFLOAT as an HSET command with the final value
|
||||||
* in order to make sure that differences in float precision or formatting
|
* in order to make sure that differences in float precision or formatting
|
||||||
* will not create differences in replicas or after an AOF restart. */
|
* will not create differences in replicas or after an AOF restart. */
|
||||||
robj *aux, *newobj;
|
robj *newobj;
|
||||||
aux = createStringObject("HSET",4);
|
|
||||||
newobj = createRawStringObject(buf,len);
|
newobj = createRawStringObject(buf,len);
|
||||||
rewriteClientCommandArgument(c,0,aux);
|
rewriteClientCommandArgument(c,0,shared.hset);
|
||||||
decrRefCount(aux);
|
|
||||||
rewriteClientCommandArgument(c,3,newobj);
|
rewriteClientCommandArgument(c,3,newobj);
|
||||||
decrRefCount(newobj);
|
decrRefCount(newobj);
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,7 @@ void spopWithCountCommand(client *c) {
|
|||||||
* Prepare our replication argument vector. Also send the array length
|
* Prepare our replication argument vector. Also send the array length
|
||||||
* which is common to both the code paths. */
|
* which is common to both the code paths. */
|
||||||
robj *propargv[3];
|
robj *propargv[3];
|
||||||
propargv[0] = createStringObject("SREM",4);
|
propargv[0] = shared.srem;
|
||||||
propargv[1] = c->argv[1];
|
propargv[1] = c->argv[1];
|
||||||
addReplySetLen(c,count);
|
addReplySetLen(c,count);
|
||||||
|
|
||||||
@ -590,13 +590,12 @@ void spopWithCountCommand(client *c) {
|
|||||||
* dirty counter. We don't want to propagate an SPOP command since
|
* dirty counter. We don't want to propagate an SPOP command since
|
||||||
* we propagated the command as a set of SREMs operations using
|
* we propagated the command as a set of SREMs operations using
|
||||||
* the alsoPropagate() API. */
|
* the alsoPropagate() API. */
|
||||||
decrRefCount(propargv[0]);
|
|
||||||
preventCommandPropagation(c);
|
preventCommandPropagation(c);
|
||||||
signalModifiedKey(c,c->db,c->argv[1]);
|
signalModifiedKey(c,c->db,c->argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void spopCommand(client *c) {
|
void spopCommand(client *c) {
|
||||||
robj *set, *ele, *aux;
|
robj *set, *ele;
|
||||||
sds sdsele;
|
sds sdsele;
|
||||||
int64_t llele;
|
int64_t llele;
|
||||||
int encoding;
|
int encoding;
|
||||||
@ -629,9 +628,7 @@ void spopCommand(client *c) {
|
|||||||
notifyKeyspaceEvent(NOTIFY_SET,"spop",c->argv[1],c->db->id);
|
notifyKeyspaceEvent(NOTIFY_SET,"spop",c->argv[1],c->db->id);
|
||||||
|
|
||||||
/* Replicate/AOF this command as an SREM operation */
|
/* Replicate/AOF this command as an SREM operation */
|
||||||
aux = createStringObject("SREM",4);
|
rewriteClientCommandVector(c,3,shared.srem,c->argv[1],ele);
|
||||||
rewriteClientCommandVector(c,3,aux,c->argv[1],ele);
|
|
||||||
decrRefCount(aux);
|
|
||||||
|
|
||||||
/* Add the element to the reply */
|
/* Add the element to the reply */
|
||||||
addReplyBulk(c,ele);
|
addReplyBulk(c,ele);
|
||||||
|
@ -1328,19 +1328,19 @@ void streamPropagateXCLAIM(client *c, robj *key, streamCG *group, robj *groupnam
|
|||||||
* Note that JUSTID is useful in order to avoid that XCLAIM will do
|
* Note that JUSTID is useful in order to avoid that XCLAIM will do
|
||||||
* useless work in the slave side, trying to fetch the stream item. */
|
* useless work in the slave side, trying to fetch the stream item. */
|
||||||
robj *argv[14];
|
robj *argv[14];
|
||||||
argv[0] = createStringObject("XCLAIM",6);
|
argv[0] = shared.xclaim;
|
||||||
argv[1] = key;
|
argv[1] = key;
|
||||||
argv[2] = groupname;
|
argv[2] = groupname;
|
||||||
argv[3] = createStringObject(nack->consumer->name,sdslen(nack->consumer->name));
|
argv[3] = createStringObject(nack->consumer->name,sdslen(nack->consumer->name));
|
||||||
argv[4] = createStringObjectFromLongLong(0);
|
argv[4] = shared.integers[0];
|
||||||
argv[5] = id;
|
argv[5] = id;
|
||||||
argv[6] = createStringObject("TIME",4);
|
argv[6] = shared.time;
|
||||||
argv[7] = createStringObjectFromLongLong(nack->delivery_time);
|
argv[7] = createStringObjectFromLongLong(nack->delivery_time);
|
||||||
argv[8] = createStringObject("RETRYCOUNT",10);
|
argv[8] = shared.retrycount;
|
||||||
argv[9] = createStringObjectFromLongLong(nack->delivery_count);
|
argv[9] = createStringObjectFromLongLong(nack->delivery_count);
|
||||||
argv[10] = createStringObject("FORCE",5);
|
argv[10] = shared.force;
|
||||||
argv[11] = createStringObject("JUSTID",6);
|
argv[11] = shared.justid;
|
||||||
argv[12] = createStringObject("LASTID",6);
|
argv[12] = shared.lastid;
|
||||||
argv[13] = createObjectFromStreamID(&group->last_id);
|
argv[13] = createObjectFromStreamID(&group->last_id);
|
||||||
|
|
||||||
/* We use progagate() because this code path is not always called from
|
/* We use progagate() because this code path is not always called from
|
||||||
@ -1348,16 +1348,9 @@ void streamPropagateXCLAIM(client *c, robj *key, streamCG *group, robj *groupnam
|
|||||||
* consumer group state, and we don't need MULTI/EXEC wrapping because
|
* consumer group state, and we don't need MULTI/EXEC wrapping because
|
||||||
* there is no message state cross-message atomicity required. */
|
* there is no message state cross-message atomicity required. */
|
||||||
propagate(server.xclaimCommand,c->db->id,argv,14,PROPAGATE_AOF|PROPAGATE_REPL);
|
propagate(server.xclaimCommand,c->db->id,argv,14,PROPAGATE_AOF|PROPAGATE_REPL);
|
||||||
decrRefCount(argv[0]);
|
|
||||||
decrRefCount(argv[3]);
|
decrRefCount(argv[3]);
|
||||||
decrRefCount(argv[4]);
|
|
||||||
decrRefCount(argv[6]);
|
|
||||||
decrRefCount(argv[7]);
|
decrRefCount(argv[7]);
|
||||||
decrRefCount(argv[8]);
|
|
||||||
decrRefCount(argv[9]);
|
decrRefCount(argv[9]);
|
||||||
decrRefCount(argv[10]);
|
|
||||||
decrRefCount(argv[11]);
|
|
||||||
decrRefCount(argv[12]);
|
|
||||||
decrRefCount(argv[13]);
|
decrRefCount(argv[13]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1369,8 +1362,8 @@ void streamPropagateXCLAIM(client *c, robj *key, streamCG *group, robj *groupnam
|
|||||||
*/
|
*/
|
||||||
void streamPropagateGroupID(client *c, robj *key, streamCG *group, robj *groupname) {
|
void streamPropagateGroupID(client *c, robj *key, streamCG *group, robj *groupname) {
|
||||||
robj *argv[5];
|
robj *argv[5];
|
||||||
argv[0] = createStringObject("XGROUP",6);
|
argv[0] = shared.xgroup;
|
||||||
argv[1] = createStringObject("SETID",5);
|
argv[1] = shared.setid;
|
||||||
argv[2] = key;
|
argv[2] = key;
|
||||||
argv[3] = groupname;
|
argv[3] = groupname;
|
||||||
argv[4] = createObjectFromStreamID(&group->last_id);
|
argv[4] = createObjectFromStreamID(&group->last_id);
|
||||||
@ -1380,8 +1373,6 @@ void streamPropagateGroupID(client *c, robj *key, streamCG *group, robj *groupna
|
|||||||
* consumer group state, and we don't need MULTI/EXEC wrapping because
|
* consumer group state, and we don't need MULTI/EXEC wrapping because
|
||||||
* there is no message state cross-message atomicity required. */
|
* there is no message state cross-message atomicity required. */
|
||||||
propagate(server.xgroupCommand,c->db->id,argv,5,PROPAGATE_AOF|PROPAGATE_REPL);
|
propagate(server.xgroupCommand,c->db->id,argv,5,PROPAGATE_AOF|PROPAGATE_REPL);
|
||||||
decrRefCount(argv[0]);
|
|
||||||
decrRefCount(argv[1]);
|
|
||||||
decrRefCount(argv[4]);
|
decrRefCount(argv[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1393,8 +1384,8 @@ void streamPropagateGroupID(client *c, robj *key, streamCG *group, robj *groupna
|
|||||||
*/
|
*/
|
||||||
void streamPropagateConsumerCreation(client *c, robj *key, robj *groupname, sds consumername) {
|
void streamPropagateConsumerCreation(client *c, robj *key, robj *groupname, sds consumername) {
|
||||||
robj *argv[5];
|
robj *argv[5];
|
||||||
argv[0] = createStringObject("XGROUP",6);
|
argv[0] = shared.xgroup;
|
||||||
argv[1] = createStringObject("CREATECONSUMER",14);
|
argv[1] = shared.createconsumer;
|
||||||
argv[2] = key;
|
argv[2] = key;
|
||||||
argv[3] = groupname;
|
argv[3] = groupname;
|
||||||
argv[4] = createObject(OBJ_STRING,sdsdup(consumername));
|
argv[4] = createObject(OBJ_STRING,sdsdup(consumername));
|
||||||
@ -1404,8 +1395,6 @@ void streamPropagateConsumerCreation(client *c, robj *key, robj *groupname, sds
|
|||||||
* consumer group state, and we don't need MULTI/EXEC wrapping because
|
* consumer group state, and we don't need MULTI/EXEC wrapping because
|
||||||
* there is no message state cross-message atomicity required. */
|
* there is no message state cross-message atomicity required. */
|
||||||
propagate(server.xgroupCommand,c->db->id,argv,5,PROPAGATE_AOF|PROPAGATE_REPL);
|
propagate(server.xgroupCommand,c->db->id,argv,5,PROPAGATE_AOF|PROPAGATE_REPL);
|
||||||
decrRefCount(argv[0]);
|
|
||||||
decrRefCount(argv[1]);
|
|
||||||
decrRefCount(argv[4]);
|
decrRefCount(argv[4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1725,9 +1714,7 @@ int streamParseIntervalIDOrReply(client *c, robj *o, streamID *id, int *exclude,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void streamRewriteApproxSpecifier(client *c, int idx) {
|
void streamRewriteApproxSpecifier(client *c, int idx) {
|
||||||
robj *equal_obj = createStringObject("=",1);
|
rewriteClientCommandArgument(c,idx,shared.special_equals);
|
||||||
rewriteClientCommandArgument(c,idx,equal_obj);
|
|
||||||
decrRefCount(equal_obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We propagate MAXLEN/MINID ~ <count> as MAXLEN/MINID = <resulting-len-of-stream>
|
/* We propagate MAXLEN/MINID ~ <count> as MAXLEN/MINID = <resulting-len-of-stream>
|
||||||
|
@ -631,7 +631,7 @@ void decrbyCommand(client *c) {
|
|||||||
|
|
||||||
void incrbyfloatCommand(client *c) {
|
void incrbyfloatCommand(client *c) {
|
||||||
long double incr, value;
|
long double incr, value;
|
||||||
robj *o, *new, *aux;
|
robj *o, *new;
|
||||||
|
|
||||||
o = lookupKeyWrite(c->db,c->argv[1]);
|
o = lookupKeyWrite(c->db,c->argv[1]);
|
||||||
if (checkType(c,o,OBJ_STRING)) return;
|
if (checkType(c,o,OBJ_STRING)) return;
|
||||||
@ -659,9 +659,7 @@ void incrbyfloatCommand(client *c) {
|
|||||||
* will not create differences in replicas or after an AOF restart. */
|
* will not create differences in replicas or after an AOF restart. */
|
||||||
rewriteClientCommandArgument(c,0,shared.set);
|
rewriteClientCommandArgument(c,0,shared.set);
|
||||||
rewriteClientCommandArgument(c,2,new);
|
rewriteClientCommandArgument(c,2,new);
|
||||||
aux = createStringObject("KEEPTTL",7);
|
rewriteClientCommandArgument(c,3,shared.keepttl);
|
||||||
rewriteClientCommandArgument(c,3,aux);
|
|
||||||
decrRefCount(aux);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void appendCommand(client *c) {
|
void appendCommand(client *c) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user