diff --git a/Changelog b/Changelog index e470cd07..e5df8c67 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2009-04-23 RANDOMKEY regression test added +2009-04-23 dictGetRandomKey bug fixed, RANDOMKEY will not block the server anymore 2009-04-22 FLUSHALL/FLUSHDB no longer sync on disk. Just increment the dirty counter by the number of elements removed, that will probably trigger a background saving operation 2009-04-21 forgot to comment testing code in PHP lib. Now it is ok 2009-04-21 PHP client ported to PHP5 and fixed diff --git a/TODO b/TODO index f3a911cb..89b67c57 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,6 @@ BEFORE REDIS 1.0.0-rc1 - What happens if the saving child gets killed instead to end normally? Handle this. -- Fix INCRBY argument that is limited to 32bit int. - Make sinterstore / unionstore / sdiffstore returning the cardinality of the resulting set. - Add a new field as INFO output: bgsaveinprogress - Remove max number of args limit @@ -24,6 +23,7 @@ This command should be smart and don't use too much memory, that is, take two co - Document replication - Objects sharing configuration, add the directive "objectsharingpool " - Make sure to convert all the fstat() calls to 64bit versions. +- SINTERCOUNT, SUNIONCOUNT, SDIFFCOUNT FUTURE HINTS diff --git a/redis.c b/redis.c index e74910ba..e8ed621d 100644 --- a/redis.c +++ b/redis.c @@ -2195,7 +2195,7 @@ static void mgetCommand(redisClient *c) { } } -static void incrDecrCommand(redisClient *c, int incr) { +static void incrDecrCommand(redisClient *c, long long incr) { long long value; int retval; robj *o; @@ -2237,12 +2237,12 @@ static void decrCommand(redisClient *c) { } static void incrbyCommand(redisClient *c) { - int incr = atoi(c->argv[2]->ptr); + long long incr = strtoll(c->argv[2]->ptr, NULL, 10); incrDecrCommand(c,incr); } static void decrbyCommand(redisClient *c) { - int incr = atoi(c->argv[2]->ptr); + long long incr = strtoll(c->argv[2]->ptr, NULL, 10); incrDecrCommand(c,-incr); } diff --git a/test-redis.tcl b/test-redis.tcl index 0e1c852f..63df9764 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -101,6 +101,21 @@ proc main {server port} { $r incr novar } {101} + test {INCR over 32bit value} { + $r set novar 17179869184 + $r incr novar + } {17179869185} + + test {INCRBY over 32bit value with over 32bit increment} { + $r set novar 17179869184 + $r incrby novar 17179869184 + } {34359738368} + + test {DECRBY over 32bit value with over 32bit increment, negative res} { + $r set novar 17179869184 + $r decrby novar 17179869185 + } {-1} + test {SETNX target key missing} { $r setnx novar2 foobared $r get novar2