mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
fix-out-of-index-range-for-redis-cli-findbigkey
This commit is contained in:
parent
83390f55e5
commit
640fa434f5
@ -2074,7 +2074,9 @@ static void pipeMode(void) {
|
||||
#define TYPE_SET 2
|
||||
#define TYPE_HASH 3
|
||||
#define TYPE_ZSET 4
|
||||
#define TYPE_NONE 5
|
||||
#define TYPE_STREAM 5
|
||||
#define TYPE_NONE 6
|
||||
#define TYPE_MAX_KEYS TYPE_NONE
|
||||
|
||||
static redisReply *sendScan(unsigned long long *it) {
|
||||
redisReply *reply = redisCommand(context, "SCAN %llu", *it);
|
||||
@ -2218,10 +2220,10 @@ static void getKeySizes(redisReply *keys, int *types,
|
||||
}
|
||||
|
||||
static void findBigKeys(void) {
|
||||
unsigned long long biggest[5] = {0}, counts[5] = {0}, totalsize[5] = {0};
|
||||
unsigned long long biggest[TYPE_MAX_KEYS] = {0}, counts[TYPE_MAX_KEYS] = {0}, totalsize[TYPE_MAX_KEYS] = {0};
|
||||
unsigned long long sampled = 0, total_keys, totlen=0, *sizes=NULL, it=0;
|
||||
sds maxkeys[5] = {0};
|
||||
char *typename[] = {"string","list","set","hash","zset"};
|
||||
sds maxkeys[TYPE_MAX_KEYS] = {0};
|
||||
char *typename[] = {"string","list","set","hash","zset","stream"};
|
||||
char *typeunit[] = {"bytes","items","members","fields","members"};
|
||||
redisReply *reply, *keys;
|
||||
unsigned int arrsize=0, i;
|
||||
|
Loading…
Reference in New Issue
Block a user