mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
add an assertion to make sure numkeys is 0 in getKeysUsingKeySpecs (#12389)
This is an addition to #12380, to prevent potential bugs when collecting keys from multiple commands in the future. Note that this function also resets numkeys in some cases.
This commit is contained in:
parent
1190f25ca7
commit
aefdc57f1e
2
src/db.c
2
src/db.c
@ -1873,7 +1873,7 @@ int64_t getAllKeySpecsFlags(struct redisCommand *cmd, int inv) {
|
||||
int getKeysUsingKeySpecs(struct redisCommand *cmd, robj **argv, int argc, int search_flags, getKeysResult *result) {
|
||||
int j, i, last, first, step;
|
||||
keyReference *keys;
|
||||
result->numkeys = 0;
|
||||
serverAssert(result->numkeys == 0); /* caller should initialize or reset it */
|
||||
|
||||
for (j = 0; j < cmd->key_specs_num; j++) {
|
||||
keySpec *spec = cmd->key_specs + j;
|
||||
|
Loading…
Reference in New Issue
Block a user