mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix: zunion and zunionstore zero numkeys bug (#1522)
Fixes #1442 Signed-off-by: rounaknandanwar <rounak.nandanwar@gmail.com>
This commit is contained in:
parent
4eb2012a8d
commit
674f06875c
3 changed files with 11 additions and 3 deletions
|
@ -1445,12 +1445,14 @@ 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 (name == "ZUNION" && num_custom_keys == 0) {
|
||||
return OpStatus::SYNTAX_ERR;
|
||||
}
|
||||
|
||||
if (args.size() < size_t(num_custom_keys) + num_keys_index + 1)
|
||||
return OpStatus::SYNTAX_ERR;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue