This is an automated email from the ASF dual-hosted git repository. hulk pushed a commit to branch 2.5 in repository https://gitbox.apache.org/repos/asf/kvrocks.git
commit f59c6051957cc225c15285139f6c4c0f96d4c7a7 Author: Binbin <[email protected]> AuthorDate: Mon Jul 10 17:07:57 2023 +0800 Fix SCRIPT EXISTS arity (#1567) This is a minor fix, SCRIPT EXISTS requires at least three arguments. Before the change, we can do this: ``` 127.0.0.1:6666> script exists (empty array) ``` After: we will return the wrong number of arguments error. --- src/commands/cmd_script.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/cmd_script.cc b/src/commands/cmd_script.cc index 54f115db..a076e2c2 100644 --- a/src/commands/cmd_script.cc +++ b/src/commands/cmd_script.cc @@ -79,7 +79,7 @@ class CommandScript : public Commander { return s; } *output = redis::SimpleString("OK"); - } else if (args_.size() >= 2 && subcommand_ == "exists") { + } else if (args_.size() >= 3 && subcommand_ == "exists") { *output = redis::MultiLen(args_.size() - 2); for (size_t j = 2; j < args_.size(); j++) { if (svr->ScriptExists(args_[j]).IsOK()) {
