mirror of
https://github.com/fluencelabs/redis
synced 2025-03-31 14:51:04 +00:00
dont take the fast path for INCR if the resulting integer will fit into a shared integer range
This commit is contained in:
parent
b215a496a4
commit
a15742a41b
@ -149,7 +149,8 @@ void incrDecrCommand(redisClient *c, long long incr) {
|
|||||||
if (o && o->refcount == 1 && o->encoding == REDIS_ENCODING_INT) {
|
if (o && o->refcount == 1 && o->encoding == REDIS_ENCODING_INT) {
|
||||||
long long newval = ((long)o->ptr) + incr;
|
long long newval = ((long)o->ptr) + incr;
|
||||||
|
|
||||||
if (newval >= LONG_MIN && newval <= LONG_MAX) {
|
if (newval < 0 && newval >= REDIS_SHARED_INTEGERS &&
|
||||||
|
newval >= LONG_MIN && newval <= LONG_MAX) {
|
||||||
o->ptr = (void*) (long) newval;
|
o->ptr = (void*) (long) newval;
|
||||||
touchWatchedKey(c->db,c->argv[1]);
|
touchWatchedKey(c->db,c->argv[1]);
|
||||||
server.dirty++;
|
server.dirty++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user