1. 06 Dec, 2017 1 commit
    • antirez's avatar
      Change indentation and other minor details of PR #4489. · 522760fa
      antirez authored
      The main change introduced by this commit is pretending that help
      arrays are more text than code, thus indenting them at level 0. This
      improves readability, and is an old practice when defining arrays of
      C strings describing text.
      
      Additionally a few useless return statements are removed, and the HELP
      subcommand capitalized when printed to the user.
      522760fa
  2. 04 Dec, 2017 3 commits
    • antirez's avatar
      Refactoring: improve luaCreateFunction() API. · 60d26acf
      antirez authored
      The function in its initial form, and after the fixes for the PSYNC2
      bugs, required code duplication in multiple spots. This commit modifies
      it in order to always compute the script name independently, and to
      return the SDS of the SHA of the body: this way it can be used in all
      the places, including for SCRIPT LOAD, without duplicating the code to
      create the Lua function name. Note that this requires to re-compute the
      body SHA1 in the case of EVAL seeing a script for the first time, but
      this should not change scripting performance in any way because new
      scripts definition is a rare event happening the first time a script is
      seen, and the SHA1 computation is anyway not a very slow process against
      the typical Redis script and compared to the actua Lua byte compiling of
      the body.
      
      Note that the function used to assert() if a duplicated script was
      loaded, however actually now two times over three, we want the function
      to handle duplicated scripts just fine: this happens in SCRIPT LOAD and
      in RDB AUX "lua" loading. Moreover the assert was not defending against
      some obvious failure mode, so now the function always tests against
      already defined functions at start.
      60d26acf
    • antirez's avatar
      Remove useless variable check from luaCreateFunction(). · c6eca690
      antirez authored
      The block is already inside if (allow_dup).
      c6eca690
    • antirez's avatar
      Fix issue #4505, Lua RDB AUX field loading of existing scripts. · 68681f2b
      antirez authored
      Unfortunately, as outlined by @soloestoy in #4505, "lua" AUX RDB field
      loading in case of duplicated script was still broken. This commit fixes
      this problem and also a memory leak introduced by the past commit.
      
      Note that now we have a regression test able to duplicate the issue, so
      this commit was actually tested against the regression. The original PR
      also had a valid fix, but I prefer to hide the details of scripting.c
      outside scripting.c, and later "SCRIPT LOAD" should also be able to use
      the function luaCreateFunction() instead of redoing the work.
      68681f2b
  3. 01 Dec, 2017 1 commit
  4. 30 Nov, 2017 3 commits
  5. 28 Nov, 2017 1 commit
    • Itamar Haber's avatar
      Standardizes the 'help' subcommand · 59d52f7f
      Itamar Haber authored
      This adds a new `addReplyHelp` helper that's used by commands
      when returning a help text. The following commands have been
      touched: DEBUG, OBJECT, COMMAND, PUBSUB, SCRIPT and SLOWLOG.
      
      WIP
      
      Fix entry command table entry for OBJECT for HELP option.
      
      After #4472 the command may have just 2 arguments.
      
      Improve OBJECT HELP descriptions.
      
      See #4472.
      
      WIP 2
      
      WIP 3
      59d52f7f
  6. 22 Nov, 2017 1 commit
  7. 24 Jul, 2017 1 commit
  8. 30 Jun, 2017 1 commit
  9. 11 Apr, 2017 1 commit
  10. 05 May, 2016 1 commit
  11. 02 Mar, 2016 1 commit
  12. 08 Jan, 2016 2 commits
    • antirez's avatar
      Scripting: handle trailing comments. · f43c794b
      antirez authored
      This fix, provided by Paul Kulchenko (@pkulchenko), allows the Lua
      scripting engine to evaluate statements with a trailing comment like the
      following one:
      
          EVAL "print() --comment" 0
      
      Lua can't parse the above if the string does not end with a newline, so
      now a final newline is always added automatically. This does not change
      the SHA1 of scripts since the SHA1 is computed on the body we pass to
      EVAL, without the other code we add to register the function.
      
      Close #2951.
      f43c794b
    • antirez's avatar
      Lua debugger: fix crash printing nested or deep objects. · a75aa4bf
      antirez authored
      Example of offending code:
      
      > script debug yes
      OK
      > eval "local a = {1} a[1] = a\nprint(a)" 0
      1) * Stopped at 1, stop reason = step over
      2) -> 1   local a = {1} a[1] = a
      > next
      1) * Stopped at 2, stop reason = step over
      2) -> 2   print(a)
      > print
      
      ... server crash ...
      
      Close #2955.
      a75aa4bf
  13. 16 Dec, 2015 4 commits
  14. 27 Nov, 2015 1 commit
  15. 18 Nov, 2015 1 commit
  16. 17 Nov, 2015 17 commits