We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c31da1 commit 555d6b5Copy full SHA for 555d6b5
src/redis/hyperloglog.c
@@ -1370,8 +1370,7 @@ int64_t pfcountSingle(struct HllBufferPtr hll_ptr) {
1370
}
1371
1372
/* Merge dense-encoded HLL */
1373
-static void hllMergeDense(uint8_t* max, struct HllBufferPtr to) {
1374
- uint8_t* registers = max + HLL_HDR_SIZE;
+static void hllMergeDense(uint8_t* registers, struct HllBufferPtr to) {
1375
uint8_t val;
1376
struct hllhdr* hll_hdr = (struct hllhdr*)to.hll;
1377
src/server/hll_family_test.cc
@@ -166,8 +166,15 @@ TEST_F(HllFamilyTest, MergeToNew) {
166
TEST_F(HllFamilyTest, MergeToExisting) {
167
EXPECT_EQ(CheckedInt({"pfadd", "key1", "1", "2", "3"}), 1);
168
EXPECT_EQ(CheckedInt({"pfadd", "key2", "4", "5"}), 1);
169
- EXPECT_EQ(Run({"pfmerge", "key2", "key1"}), "OK");
170
- EXPECT_EQ(CheckedInt({"pfcount", "key2"}), 5);
+ EXPECT_EQ(Run({"pfmerge", "key3", "key2", "key1"}), "OK");
+ EXPECT_EQ(CheckedInt({"pfcount", "key3"}), 5);
171
+ EXPECT_EQ(Run({"pfmerge", "key3", "key3"}), "OK");
172
173
+ EXPECT_EQ(Run({"pfmerge", "key3"}), "OK");
174
175
+ EXPECT_EQ(CheckedInt({"pfadd", "key4", "4", "5", "6"}), 1);
176
+ EXPECT_EQ(Run({"pfmerge", "key3", "key4"}), "OK");
177
+ EXPECT_EQ(CheckedInt({"pfcount", "key3"}), 6);
178
179
180
TEST_F(HllFamilyTest, MergeNonExisting) {
0 commit comments