summaryrefslogtreecommitdiff
path: root/src/rdb.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-12-09 23:08:01 +0800
committerGitHub <noreply@github.com>2022-12-09 17:08:01 +0200
commit20854cb6109c23e65dca0174517f3861a55cb694 (patch)
tree4a11c1cb4f83d640e66366eadfe88ce85dbada44 /src/rdb.c
parent528bb11d7a25cde99e6d48c418662575c64758b2 (diff)
downloadredis-20854cb6109c23e65dca0174517f3861a55cb694.tar.gz
Fix zuiFind crash / RM_ScanKey hang on SET object listpack encoding (#11581)
In #11290, we added listpack encoding for SET object. But forgot to support it in zuiFind, causes ZINTER, ZINTERSTORE, ZINTERCARD, ZIDFF, ZDIFFSTORE to crash. And forgot to support it in RM_ScanKey, causes it hang. This PR add support SET listpack in zuiFind, and in RM_ScanKey. And add tests for related commands to cover this case. Other changes: - There is no reason for zuiFind to go into the internals of the SET. It can simply use setTypeIsMember and don't care about encoding. - Remove the `#include "intset.h"` from server.h reduce the chance of accidental intset API use. - Move setTypeAddAux, setTypeRemoveAux and setTypeIsMemberAux interfaces to the header. - In scanGenericCommand, use setTypeInitIterator and setTypeNext to handle OBJ_SET scan. - In RM_ScanKey, improve hash scan mode, use lpGetValue like zset, they can share code and better performance. The zuiFind part fixes #11578 Co-authored-by: Oran Agra <oran@redislabs.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
Diffstat (limited to 'src/rdb.c')
-rw-r--r--src/rdb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rdb.c b/src/rdb.c
index 8a99d4aa2..b1c25bcff 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -34,6 +34,7 @@
#include "fpconv_dtoa.h"
#include "stream.h"
#include "functions.h"
+#include "intset.h" /* Compact integer set structure */
#include <math.h>
#include <fcntl.h>