1. 29 Jun, 2015 4 commits
  2. 27 Jun, 2015 1 commit
  3. 26 Jun, 2015 1 commit
    • antirez's avatar
      Geo: from lat,lon API to lon,lat API according to GIS standard · fa9d62d3
      antirez authored
      The GIS standard and all the major DBs implementing GIS related
      functions take coordinates as x,y that is longitude,latitude.
      It was a bad start for Redis to do things differently, so even if this
      means that existing users of the Geo module will be required to change
      their code, Redis now conforms to the standard.
      
      Usually Redis is very backward compatible, but this is not an exception
      to this rule, since this is the first Geo implementation entering the
      official Redis source code. It is not wise to try to be backward
      compatible with code forks... :-)
      
      Close #2637.
      fa9d62d3
  4. 24 Jun, 2015 2 commits
    • antirez's avatar
      Geo: GEOHASH command test. · 5fd756bf
      antirez authored
      5fd756bf
    • antirez's avatar
      Geo: GEORADIUS fuzzy testing by reimplementing it in Tcl. · cf89a19f
      antirez authored
      We set random points in the world, pick a random position, and check if
      the returned points by Redis match the ones computed by Tcl by brute
      forcing all the points using the distance between two points formula.
      
      This approach is sounding since immediately resulted in finding a bug in
      the original implementation.
      cf89a19f
  5. 23 Jun, 2015 1 commit
  6. 22 Jun, 2015 3 commits
    • antirez's avatar
      Geo: fix tests after distance precision change · 575e247a
      antirez authored
      575e247a
    • antirez's avatar
      Geo: removed JSON failing test (false positive) · 73134f6a
      antirez authored
      Server output is matched to a pre-computed output. The last digits
      differ because of rouding errors.
      73134f6a
    • Matt Stancliff's avatar
      [In-Progress] Add Geo Commands · 7f4ac3d1
      Matt Stancliff authored
      Current todo:
        - replace functions in zset.{c,h} with a new unified Redis
          zset access API.
      
      Once we get the zset interface fixed, we can squash
      relevant commits in this branch and have one nice commit
      to merge into unstable.
      
      This commit adds:
        - Geo commands
        - Tests; runnable with: ./runtest --single unit/geo
        - Geo helpers in deps/geohash-int/
        - src/geo.{c,h} and src/geojson.{c,h} implementing geo commands
        - Updated build configurations to get everything working
        - TEMPORARY: src/zset.{c,h} implementing zset score and zset
          range reading without writing to client output buffers.
        - Modified linkage of one t_zset.c function for use in zset.c
      
      Conflicts:
      	src/Makefile
      	src/redis.c
      7f4ac3d1
  7. 29 May, 2015 3 commits
  8. 17 Apr, 2015 1 commit
  9. 27 Feb, 2015 2 commits
    • antirez's avatar
      Test: HSTRLEN stress test of corner cases. · 084a59c3
      antirez authored
      Main point here is to correctly report LLONG_MIN length, since to take
      the absolute value we need care in sdigits10().
      084a59c3
    • antirez's avatar
      Hash: HSTRLEN (was HVSTRLEN) improved. · 4e54b85a
      antirez authored
      1. HVSTRLEN -> HSTRLEN. It's unlikely one needs the length of the key,
         not clear how the API would work (by value does not make sense) and
         there will be better names anyway.
      2. Default is to return 0 when field is missing.
      3. Default is to return 0 when key is missing.
      4. The implementation was slower than needed, and produced unnecessary COW.
      
      Related issue #2415.
      4e54b85a
  10. 25 Feb, 2015 2 commits
  11. 23 Feb, 2015 1 commit
  12. 21 Feb, 2015 1 commit
  13. 11 Feb, 2015 1 commit
  14. 10 Feb, 2015 1 commit
    • antirez's avatar
      Faster memory efficiency test. · 5e3dcc52
      antirez authored
      This test on Linux was extremely slow, since in Tcl we can't enable
      easily tcp-nodelay, so the busy loop used to take *a lot* with bigger
      writes. Fixed using pipelining.
      5e3dcc52
  15. 02 Jan, 2015 3 commits
  16. 14 Dec, 2014 1 commit
    • Alon Diamant's avatar
      Added <count> parameter to SPOP: · 28802887
      Alon Diamant authored
      spopCommand() now runs spopWithCountCommand() in case the <count> param is found.
      Added intsetRandomMembers() to Intset: Copies N random members from the set into inputted 'values' array. Uses either the Knuth or Floyd sample algos depending on ratio count/size.
      Added setTypeRandomElements() to SET type: Returns a number of random elements from a non empty set. This is a version of setTypeRandomElement() that is modified in order to return multiple entries, using dictGetRandomKeys() and intsetRandomMembers().
      Added tests for SPOP with <count>: unit/type/set, unit/scripting, integration/aof
      --
      Cleaned up code a bit to match with required Redis coding style
      28802887
  17. 03 Dec, 2014 1 commit
  18. 14 Nov, 2014 2 commits
    • Matt Stancliff's avatar
      Lua: add cmsgpack scripting tests · ace628c7
      Matt Stancliff authored
      Basically: test to make sure we can load cmsgpack
      and do some sanity checks to make sure pack/unpack works
      properly.  We also have a bonus test for circular encoding
      and decoding because I was curious how it worked.
      ace628c7
    • Matt Stancliff's avatar
      Lua: add cjson scripting test · e327c8ed
      Matt Stancliff authored
      Two simple decode tests added mainly to check that
      the 'cjson' global gets registered and is usable.
      e327c8ed
  19. 29 Oct, 2014 1 commit
    • Matt Stancliff's avatar
      Fix zero-ordering SORT when called against lists · 6c0abc4a
      Matt Stancliff authored
      People mostly use SORT against lists, but our prior
      behavior was pretending lists were an unordered bag
      requiring a forced-sort when no sort was requested.
      
      We can just use the native list ordering to ensure
      consistency across replicaion and scripting calls.
      
      Closes #2079
      Closes #545 (again)
      6c0abc4a
  20. 09 Oct, 2014 1 commit
    • Matt Stancliff's avatar
      Lua: Add bitop · 3fecb961
      Matt Stancliff authored
      A few people have written custom C commands because bit
      manipulation isn't exposed through Lua.  Let's give
      them Mike Pall's bitop.
      
      This adds bitop 1.0.2 (2012-05-08) from http://bitop.luajit.org/
      
      bitop is imported as "bit" into the global namespace.
      
      New Lua commands: bit.tobit, bit.tohex, bit.bnot, bit.band, bit.bor, bit.bxor,
      bit.lshift, bit.rshift, bit.arshift, bit.rol, bit.ror, bit.bswap
      
      Verification of working (the asserts would abort on error, so (nil) is correct):
      127.0.0.1:6379> eval "assert(bit.tobit(1) == 1); assert(bit.band(1) == 1); assert(bit.bxor(1,2) == 3); assert(bit.bor(1,2,4,8,16,32,64,128) == 255)" 0
      (nil)
      127.0.0.1:6379> eval 'assert(0x7fffffff == 2147483647, "broken hex literals"); assert(0xffffffff == -1 or 0xffffffff == 2^32-1, "broken hex literals"); assert(tostring(-1) == "-1", "broken tostring()"); assert(tostring(0xffffffff) == "-1" or tostring(0xffffffff) == "4294967295", "broken tostring()")' 0
      (nil)
      
      Tests also integrated into the scripting tests and can be run with:
      ./runtest --single unit/scripting
      
      Tests are excerpted from `bittest.lua` included in the bitop distribution.
      3fecb961
  21. 03 Oct, 2014 1 commit
  22. 29 Sep, 2014 2 commits
  23. 01 Sep, 2014 1 commit
  24. 08 Aug, 2014 2 commits
    • Matt Stancliff's avatar
      Reject MOVE to non-integer DBs · 498ad748
      Matt Stancliff authored
      Previously, "MOVE key somestring" would move the key to
      DB 0 which is just unexpected and wrong.
      String as DB == error.
      
      Test added too.
      
      Modified by @antirez in order to use the getLongLongFromObject() API
      instead of strtol().
      
      Fixes #1428
      498ad748
    • Matt Stancliff's avatar
      pubsub: Return integers for NUMSUB, not strings · 25791550
      Matt Stancliff authored
      Also adds test for numsub — due to tcl being tcl,
      it doesn't capture the "numberness" of the fix,
      but now we at least have one test case for numsub.
      
      Closes #1561
      25791550
  25. 07 Aug, 2014 1 commit
    • Matt Stancliff's avatar
      Fix key extraction for SORT · 87815ab5
      Matt Stancliff authored
      We only want to use the last STORE key, but we have to record
      we actually found a STORE key so we can increment the final return
      key count.
      
      Test added to prevent further regression.
      
      Closes #1883, #1645, #1647
      87815ab5