Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALL simple issue fixes #1906

Closed
wants to merge 65 commits into from
Closed

ALL simple issue fixes #1906

wants to merge 65 commits into from

Commits on Aug 1, 2014

  1. Copy the full SHA
    1782d04 View commit details
    Browse the repository at this point in the history
  2. redis-cli: Re-attach selected DB after auth

    Previously, if you did SELECT then AUTH, redis-cli
    would show your SELECT'd db even though it didn't
    happen.
    
    Note: running into this situation is a (hopefully) very limited
    used case of people using multiple DBs and AUTH all at the same
    time.
    
    Fixes antirez#1639
    mattsta committed Aug 1, 2014
    Copy the full SHA
    a1b42b3 View commit details
    Browse the repository at this point in the history
  3. redis-cli: stop showing incorrectly selected DB

    Previously redis-cli would happily show "-1" or "99999"
    as valid DB choices.
    
    Now, if the SELECT call returned an error, we don't update
    the DB number in the CLI.
    
    Inspired by @anupshendkar in redis#1313
    
    Fixes redis#566, redis#1313
    mattsta committed Aug 1, 2014
    Copy the full SHA
    19b5997 View commit details
    Browse the repository at this point in the history
  4. redis-cli: Add --no-raw option

    Some people need formatted output even when they have no
    interactive tty.
    
    Fixes redis#760
    mattsta committed Aug 1, 2014
    Copy the full SHA
    f2252d1 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2014

  1. Add support for compiling on AIX

    Closes redis#1900
    siahh authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    3591fbc View commit details
    Browse the repository at this point in the history
  2. Fix key extraction for SORT

    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 redis#1883, redis#1645, redis#1647
    mattsta committed Aug 2, 2014
    Copy the full SHA
    4b54b1e View commit details
    Browse the repository at this point in the history
  3. Handle large getrange requests

    Previously the end was casted to a smaller type
    which resulted in a wrong check and failed
    with values larger than handled by unsigned.
    
    Closes redis#1847, redis#1844
    badboy authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    f62cb0e View commit details
    Browse the repository at this point in the history
  4. scripting: no eval with negative key count

    Negative key count causes segfault in Lua functions.
    
    Fixes redis#1842
    Closes redis#1843
    mattsta committed Aug 2, 2014
    Copy the full SHA
    7da1992 View commit details
    Browse the repository at this point in the history
  5. cluster: fix node connection memory leak

    Cluster leaks memory while connecting due to missing freeaddrinfo()
    
    Closes redis#1801
    kingsumos authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    0efac15 View commit details
    Browse the repository at this point in the history
  6. redis-cli: fix latency result output

    (Cleaned up a little by @mattsta)
    
    Closes redis#1774
    badboy authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    a159b1f View commit details
    Browse the repository at this point in the history
  7. Remove redundant else/return block

    wjin authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    46f90e4 View commit details
    Browse the repository at this point in the history
  8. Fix intset midpoint selection

    The classic (min+max)/2 is provably unsafe.  Fixed
    as recommended in research:
    http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html
    
    Fix inspired by @wjin, but I used a different approach.
    (later, I found @kuebler fixed the same issue too).
    
    Fixes redis#1741, redis#1602
    mattsta committed Aug 2, 2014
    Copy the full SHA
    4aa3300 View commit details
    Browse the repository at this point in the history
  9. install_server.sh: add missing bang

    This was discovered by _bodya and reported in the IRC channel.
    Everything worked fine as these scripts are always executed as shell
    scripts.
    
    Closes redis#1728
    badboy authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    47cfac9 View commit details
    Browse the repository at this point in the history
  10. Fix assert technical correctness

    dictAdd returns DICT_OK, not REDIS_OK. They both
    have the same underlying values, so it works even though
    the code is technically wrong.
    
    Fixes redis#1512
    mattsta committed Aug 2, 2014
    Copy the full SHA
    008d4da View commit details
    Browse the repository at this point in the history
  11. Change unixsocketperm comment to 700 from 755

    According to unix manuals, "Connecting to the socket object requires
    read/write permission." -- mode 755 is useless for anybody
    other than the owner.
    
    Fixes redis#1696
    edgarsi authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    c200a67 View commit details
    Browse the repository at this point in the history
  12. redis-check-dump: use names instead of magic nums

    Use constants to avoid magic numbers in `types`, which is an array
    that stores the names of `REDIS` types.
    
    Closes redis#1681
    ripcurld00d authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    0ad4417 View commit details
    Browse the repository at this point in the history
  13. Fix issues raised by clang analyzer

    Closes redis#1660
    kashif authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    534356d View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    734a943 View commit details
    Browse the repository at this point in the history
  15. Factor out duplicate signal handling code

    No options are set for SIGTERM, so we can use the simpler
    signal handling interface and remove unnecessary structure initilization.
    
    sigemptyset() is moved outside of the ifdef to prevent any potential
    unused variable warning.
    
    Closes redis#1637
    mattsta committed Aug 2, 2014
    Copy the full SHA
    2af2c63 View commit details
    Browse the repository at this point in the history
  16. Use 'void' for zero-argument functions

    According to the C standard,
    it is desirable to give the type 'void'
    to functions have no argument.
    
    Closes redis#1631
    cubicdaiya authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    4b99ecb View commit details
    Browse the repository at this point in the history
  17. scripting: Add error handler only when needed

    Cleans up the flow of code to read much easier too.
    
    Closes redis#1615
    jbochi authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    1646df6 View commit details
    Browse the repository at this point in the history
  18. memtest: Add missing free()

    Closes redis#1614
    Xian Li authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    ef693f1 View commit details
    Browse the repository at this point in the history
  19. src/Makefile: Reword "to run make test" message

    Closes redis#1610
    Joshua Anderson authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    28e6d66 View commit details
    Browse the repository at this point in the history
  20. pubsub: Return integers for NUMSUB, not strings

    Also adds test for numsub 鈥斅燿ue 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 redis#1561
    mattsta committed Aug 2, 2014
    Copy the full SHA
    b1d224a View commit details
    Browse the repository at this point in the history
  21. Avoid unnecessary decoding in ziplist.c

    Closes redis#1519
    alghak authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    028f857 View commit details
    Browse the repository at this point in the history
  22. Avoid slave loading RDB on startup

    The replica instance will immediately sync with a master anyway,
    so we don't need to load anything from disk.
    
    If we add support for PSYNC after instance restart, we will
    need different logic here anyway.
    
    Closes redis#1543
    charsyam authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    bb8ce05 View commit details
    Browse the repository at this point in the history
  23. Improve accuracy of HAVE_ATOMIC dependency check

    [I had to split out the clang check due to
     clang *really* not liking the __GLIBC_PREREQ macro; -matt]
    
    Closes redis#1456
    reflection authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    0e90b76 View commit details
    Browse the repository at this point in the history
  24. Copy the full SHA
    57de6c3 View commit details
    Browse the repository at this point in the history
  25. Reject MOVE to non-integer DBs

    Previously, "MOVE key somestring" would move the key to
    DB 0 which is just unexpected and wrong.
    String as DB == error.
    
    Test added too.
    
    Fixes redis#1428
    mattsta committed Aug 2, 2014
    Copy the full SHA
    289dc21 View commit details
    Browse the repository at this point in the history
  26. Remove always-true condition check

    Closes redis#1376
    charsyam authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    bd4d5ed View commit details
    Browse the repository at this point in the history
  27. Free memory in clusterLoadConfig error handler

    Closes redis#1327
    hsb0818 authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    a7a907c View commit details
    Browse the repository at this point in the history
  28. Fix keytable size calculation

    We only need to allocate memory for key positions, not
    for every argument position.  The most keys we can have
    is total arguments / keystep.
    
    Closes redis#1300
    hsb0818 authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    34d0362 View commit details
    Browse the repository at this point in the history
  29. redis-check-dump: Prevent segfault if can't malloc

    Found by The Mayhem Team (Alexandre Rebert, Thanassis Avgerinos,
    Sang Kil Cha, David Brumley, Manuel Egele) Cylab, Carnegie Mellon
    University. See http://bugs.debian.org/716259 for more.
    
    Signed-off-by: Chris Lamb <lamby@debian.org>
    
    Fixes redis#1191
    lamby authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    5434c99 View commit details
    Browse the repository at this point in the history
  30. Add redis-benchmark PUBLISH test

    Closes redis#1186
    ybrs authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    4cb3991 View commit details
    Browse the repository at this point in the history
  31. Cleanup double semicolons

    Closes redis#1161
    mattsta committed Aug 2, 2014
    Copy the full SHA
    513d0fc View commit details
    Browse the repository at this point in the history
  32. Remove unused LINE_BUFLEN definition

    Closes redis#1129
    charsyam authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    18fac32 View commit details
    Browse the repository at this point in the history
  33. Remove duplicate prototypes in redis.h

    Also moves acceptHandler() to be near the other accept...() functions.
    
    Closes redis#1105
    charsyam authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    fea5c33 View commit details
    Browse the repository at this point in the history
  34. Use resolv library in Solaris

    For some Solaris flavours, the inet_aton in in resolv library.
    Not linking this library will introduce link error.
    
    Improves compatability with older Solaris and still
    works on new Solaris.
    
    Closes redis#1092
    NanXiao authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    48645ee View commit details
    Browse the repository at this point in the history
  35. Copy the full SHA
    00ff893 View commit details
    Browse the repository at this point in the history
  36. va_copy must be matched by va_end

    Hat tip to @rfuchs. See: redis/hiredis#178.
    
    Fixes redis#1187
    pietern authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    c3db4f7 View commit details
    Browse the repository at this point in the history
  37. Use unsigned length in sds header

    People have reported redis-cli segfaults because
    of large sds allocations.
    
    [Additional fixes by matt:
      - add the unsigned storage class to sds in hiredis
      - convert sdsIncrLen from int to long so assert works]
    
    All tests pass.
    
    Fixes redis#1188
    Scott J. Goldman authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    3f8f158 View commit details
    Browse the repository at this point in the history
  38. Refactor cluster flag printing

    Less copy/paste code duplication.
    
    Closes redis#952
    charsyam authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    d1edcae View commit details
    Browse the repository at this point in the history
  39. Copy the full SHA
    76ff589 View commit details
    Browse the repository at this point in the history
  40. Remove unused function

    Closes redis#878
    ccding authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    1d11a13 View commit details
    Browse the repository at this point in the history
  41. Extend range of bytesToHuman to TB and PB

    Also adds a fallthrough case for when given
    large values (like overflow numbers of 2^64 by mistake).
    
    Closes redis#858
    dvdplm authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    6d1b51d View commit details
    Browse the repository at this point in the history
  42. Add error check for writing RDB checksum

    Closes redis#857
    yoav-steinberg authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    4c75bf0 View commit details
    Browse the repository at this point in the history
  43. redis-cli: fix prompt after shutdown command

    Fix redis-cli prompt to state "not connected" after a SHUTDOWN command
    is sent.
    Dov Murik authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    e8fb537 View commit details
    Browse the repository at this point in the history
  44. Fix error message of SETEX/PSETEX

    This is a rewritten version of redis#811
    
    Closes redis#811
    mattsta committed Aug 2, 2014
    Copy the full SHA
    2a0c018 View commit details
    Browse the repository at this point in the history
  45. Support cross-compiling for uClibc targets

    Disable backtrace support in src/config.h if uClibc is detected.
    
    Tested on the following platforms:
    
    - sh4-linux-uclibc (GCC 4.1.1, uClibc 0.9.29)
    - mipsel-linux-uclibc (GCC 4.4.5, uClibc 0.9.29)
    
    To cross-compile:
    
        $ make CC=mipsel-linux-gcc MALLOC=libc
    
    Signed-off-by: Michael Steinert <mike.steinert@gmail.com>
    
    Closes redis#537
    msteinert authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    aaf2db3 View commit details
    Browse the repository at this point in the history
  46. Clarify argument to dict macro

    d is more clear because the type of argument is dict not dictht
    
    Closes redis#513
    xiaoyu authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    27a9dbd View commit details
    Browse the repository at this point in the history
  47. Create PID file even if in foreground

    Previously, Redis only wrote the pid file if
    it was daemonizing, but many times it's useful to have
    the pid written out even if you're in the foreground.
    
    Some background for this is:
    I usually run redis via daemontools. That entails running
    redis-server on the foreground. Given that, I'd also want
    redis-server to create a pidfile so other processes (e.g. nagios)
    can run checks for that.
    
    Closes redis#463
    rebx authored and mattsta committed Aug 2, 2014
    Copy the full SHA
    4a799b6 View commit details
    Browse the repository at this point in the history
  48. Remove unused global variable

    It has an important name, but nothing uses it...
    mattsta committed Aug 2, 2014
    Copy the full SHA
    4ba3898 View commit details
    Browse the repository at this point in the history
  49. Fix memory leak in cluster config parsing

    The continue stop us from triggering the
    free after the long line for loop, so add it
    earlier.
    mattsta committed Aug 2, 2014
    Copy the full SHA
    74cf21b View commit details
    Browse the repository at this point in the history
  50. Cluster: Fix segfault if cluster config corrupt

    This commit adds a size check after initial config
    line parsing to make sure we have *at least* 8 arguments
    per line.
    
    Also, instead of asserting for cluster->myself, we just test
    and error out normally (since the error does a hard exit anyway).
    
    Closes redis#1597
    mattsta committed Aug 2, 2014
    Copy the full SHA
    74dd6c8 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2014

  1. Sentinel: Reject config from STDIN

    Sentinel needs to die with a more accurate error message
    when attempted to open a config from STDIN.
    
    See: https://groups.google.com/forum/#!topic/redis-db/sYx7VNMWaNM
    mattsta committed Aug 4, 2014
    Copy the full SHA
    e3ab9a5 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2014

  1. Stop tests from leaving a black background

    Uses ANSI "default background" color code after closing tests
    so any non-black terminals don't remain polluted.
    
    Fixes redis#1649
    Closes redis#1912
    mariano-perez-rodriguez authored and mattsta committed Aug 5, 2014
    Copy the full SHA
    4547223 View commit details
    Browse the repository at this point in the history
  2. Use correct github url to find commands.json

    Once this is merged:
      - merge the latest changes to commands.json in antirez/redis-doc
      - re-run: utils/generate-command-help.rb > src/help.h
    
    Then we'll have nice and easy tab-completed help in redis-cli again.
    
    Closes redis#1909
    badboy authored and mattsta committed Aug 5, 2014
    Copy the full SHA
    61c1a79 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2014

  1. Sentinel: fix bufsize to support IPv6 address

    Closes redis#1914
    eiiches authored and mattsta committed Aug 6, 2014
    Copy the full SHA
    ac0ccd7 View commit details
    Browse the repository at this point in the history
  2. Rename two 'buf' vars to 'ip' for better clarity

    Clearly ip[32] is wrong, but it's less clear that buf[32] was wrong
    without further reading.
    mattsta committed Aug 6, 2014
    Copy the full SHA
    080b043 View commit details
    Browse the repository at this point in the history
  3. redis-benchmark: add auth option

    Closes redis#1097
    charsyam authored and mattsta committed Aug 6, 2014
    Copy the full SHA
    eec73e7 View commit details
    Browse the repository at this point in the history
  4. redis-benchmark: Remove unused buffer

    This just deletes old code that didn't get removed when
    logic changed.  We were setting offsets that never
    got read anywhere.
    
    Since clients are now just cloned, we don't need to track
    per-client buffer offsets anywhere because they are all
    the same from the original client.
    mattsta committed Aug 6, 2014
    Copy the full SHA
    8349dc6 View commit details
    Browse the repository at this point in the history
  5. Fix potential error when generating INFO string

    Clang (scan-build) flags this as an error, but it can't
    happen under normal usage because the input is verified
    in caller function.  Clang doesn't trust the caller
    to always pass correct input though, so it gets registered
    as an error in the report.
    
    It's better to remove the possibility of a crash, even if
    only technically.  It also makes our error report cleaner
    since we know this isn't a problem.
    mattsta committed Aug 6, 2014
    Copy the full SHA
    09b619a View commit details
    Browse the repository at this point in the history
  6. Sentinel: Improve INFO command behavior

    Improvements:
      - Return error if asking for bad section (INFO foo)
      - Fix potential memory leak (caused by sdsempty() then returned if >2 args)
      - Clean up argument parsing
      - Allow "all" as valid section (same as "default" or zero args currently)
      - Move strcasecmp to end of evaluation chain in conditionals
    
    Also, since we're C99, I moved some variable declarations to be closer
    to where they are actually used (saves us from needing to free an empty info
    if detect argument errors up front).
    
    Closes redis#1915
    mattsta committed Aug 6, 2014
    Copy the full SHA
    f92f2d2 View commit details
    Browse the repository at this point in the history
  7. Deny CLIENT command in scripts

    We don't want scripts doing CLIENT SETNAME
    or CLIENT KILL or CLIENT LIST or CLIENT PAUSE.
    
    Originally reported by Chris Wj then proper
    action inspired by Itamar Haber.
    
    Reference: https://groups.google.com/forum/#!topic/redis-db/09B2EYwyVgk
    mattsta committed Aug 6, 2014
    Copy the full SHA
    a7397d0 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2014

  1. Copy the full SHA
    060718a View commit details
    Browse the repository at this point in the history