antirez/redis — Issue #330: INCRBY / HINCRBY different overflow behavior
Author: antirez
Created: 2012-02-05 10:12:29+00:00
State: open
Labels: 2.4 merge candidate, non critical bug

Quoting a message from the mailing list

```
set n -9223372036854775484
+OK
incrby n -100000
-ERR increment or decrement would overflow
incrby n -1000
-ERR increment or decrement would overflow
hput f n -9223372036854775484
-ERR unknown command 'hput'
hset f n -9223372036854775484
:1
hget f n
$20
-9223372036854775484
hincrby f n -10000
:9223372036854766132
hincrby f n 10000
:-9223372036854775484

So is this by design? or a bug?

How do i get the same/similar behavior as INCRBY -- basically if it's
going to overflow, either returning error or returning MAX_LONG.
```