fix: fix BLOCKING/REVERSE_MAPPING flags for some commands (#2516)

* fix: BLOCKING/REVERSE_MAPPING flags for some commands

Also, simplify interfaces around REVERSE_MAPPING in the internal tx code.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2024-02-01 17:39:14 +02:00 committed by GitHub
parent 5189dae118
commit b5b5093165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 38 additions and 33 deletions

View file

@ -71,13 +71,13 @@ struct KeyIndex {
// if index is non-zero then adds another key index (usually 0).
// relevant for for commands like ZUNIONSTORE/ZINTERSTORE for destination key.
std::optional<uint16_t> bonus{};
bool has_reverse_mapping = false;
static KeyIndex Empty() {
return KeyIndex{0, 0, 0, std::nullopt};
KeyIndex(unsigned s = 0, unsigned e = 0, unsigned step = 0) : start(s), end(e), step(step) {
}
static KeyIndex Range(unsigned start, unsigned end, unsigned step = 1) {
return KeyIndex{start, end, step, std::nullopt};
return KeyIndex{start, end, step};
}
bool HasSingleKey() const {