feat(zset family): Implement ZDiff command issue #1311 (#1333)

Signed-off-by: Kostas <kostaskyrim@gmail.com>
This commit is contained in:
Kostas Kyrimis 2023-06-05 18:26:01 +03:00 committed by GitHub
parent bf44b56667
commit 42116fa012
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 141 additions and 0 deletions

View file

@ -1432,6 +1432,12 @@ OpResult<KeyIndex> DetermineKeys(const CommandId* cid, CmdArgList args) {
if (!absl::SimpleAtoi(num, &num_custom_keys) || num_custom_keys < 0)
return OpStatus::INVALID_INT;
// TODO Fix this for Z family functions.
// Examples that crash: ZUNION 0 myset
if (name == "ZDIFF" && num_custom_keys == 0) {
return OpStatus::INVALID_INT;
}
if (args.size() < size_t(num_custom_keys) + num_keys_index + 1)
return OpStatus::SYNTAX_ERR;
}