summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-10-23 01:41:17 +0800
committerGitHub <noreply@github.com>2022-10-22 20:41:17 +0300
commit9e1b879f5bcbf105d5581c77f8c368b0ef1708f6 (patch)
treed5507669bcd33f522078388c1e07108740e5906d /src/commands
parent6dd213558b0f77e2233743718e23556fb06a557e (diff)
downloadredis-9e1b879f5bcbf105d5581c77f8c368b0ef1708f6.tar.gz
Make PFMERGE source key optional in docs, add tests with one input key, add tests on missing source keys (#11205)
The following two cases will create an empty destkey HLL: 1. called with no source keys, like `pfmerge destkey` 2. called with non-existing source keys, like `pfmerge destkey non-existing-source-key` In the first case, in `PFMERGE`, the dest key is actually one of the source keys too. So `PFMERGE k1 k2` is equivalent to `SUNIONSTORE k1 k1 k2`, and `PFMERGE k1` is equivalent to `SUNIONSTORE k1 k1`. So the first case is reasonable, the source key is actually optional. And the second case, `PFMERGE` on missing keys should succeed and create an empty dest. This is consistent with `PFCOUNT`, and also with `SUNIONSTORE`, no need to change.
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/pfmerge.json1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/commands/pfmerge.json b/src/commands/pfmerge.json
index ae18dad1e..648a8b43a 100644
--- a/src/commands/pfmerge.json
+++ b/src/commands/pfmerge.json
@@ -62,6 +62,7 @@
"name": "sourcekey",
"type": "key",
"key_spec_index": 1,
+ "optional": true,
"multiple": true
}
]