This is an automated email from the ASF dual-hosted git repository.
twice pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new 002feb55 Fix ZINTERSTORE command key range (#1697)
002feb55 is described below
commit 002feb554b05c2d05bf32aef509a748ee4850986
Author: Binbin <[email protected]>
AuthorDate: Thu Aug 24 20:12:31 2023 +0800
Fix ZINTERSTORE command key range (#1697)
---
src/commands/cmd_zset.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/commands/cmd_zset.cc b/src/commands/cmd_zset.cc
index 79c18862..70439e68 100644
--- a/src/commands/cmd_zset.cc
+++ b/src/commands/cmd_zset.cc
@@ -1348,6 +1348,11 @@ class CommandZInterStore : public CommandZUnionStore {
*output = redis::Integer(size);
return Status::OK();
}
+
+ static CommandKeyRange Range(const std::vector<std::string> &args) {
+ int num_key = *ParseInt<int>(args[1], 10);
+ return {3, 2 + num_key, 1};
+ }
};
class CommandZScan : public CommandSubkeyScanBase {
@@ -1378,7 +1383,7 @@ REDIS_REGISTER_COMMANDS(MakeCmdAttr<CommandZAdd>("zadd",
-4, "write", 1, 1, 1),
MakeCmdAttr<CommandZCard>("zcard", 2, "read-only", 1,
1, 1),
MakeCmdAttr<CommandZCount>("zcount", 4, "read-only",
1, 1, 1),
MakeCmdAttr<CommandZIncrBy>("zincrby", 4, "write", 1,
1, 1),
- MakeCmdAttr<CommandZInterStore>("zinterstore", -4,
"write", 1, 1, 1),
+ MakeCmdAttr<CommandZInterStore>("zinterstore", -4,
"write", CommandZInterStore::Range),
MakeCmdAttr<CommandZLexCount>("zlexcount", 4,
"read-only", 1, 1, 1),
MakeCmdAttr<CommandZPopMax>("zpopmax", -2, "write", 1,
1, 1),
MakeCmdAttr<CommandZPopMin>("zpopmin", -2, "write", 1,
1, 1),