How do redis increment commands react to overflow?

215 Views Asked by At

In redis integer increment commands, more specifically:

INCR / INCRBY
HINCRBY

what is the behavior when incrementing 1-past the maximum value (ie 64bit signed range)?

1

There are 1 best solutions below

0
slorello On BEST ANSWER

It would error saying that the increment would overflow:

127.0.0.1:6379> set foo 9223372036854775807
OK
127.0.0.1:6379> incr foo
(error) ERR increment or decrement would overflow