fix(rdb): Fix RDB load bug when loading hset

This commit is contained in:
Roman Gershman 2022-09-18 13:15:39 +03:00
parent d3c848f97a
commit 7ed808d5d0
3 changed files with 33 additions and 22 deletions

View file

@ -5,6 +5,7 @@
extern "C" {
#include "redis/crc64.h"
#include "redis/redis_aux.h"
#include "redis/zmalloc.h"
}
@ -257,4 +258,15 @@ TEST_F(RdbTest, SaveManyDbs) {
}
}
TEST_F(RdbTest, HMapBugs) {
// Force OBJ_ENCODING_HT encoding.
server.hash_max_listpack_value = 0;
Run({"hset", "hmap1", "key1", "val", "key2", "val2"});
Run({"hset", "hmap2", "key1", string(690557, 'a')});
server.hash_max_listpack_value = 32;
Run({"debug", "reload"});
EXPECT_EQ(2, CheckedInt({"hlen", "hmap1"}));
}
} // namespace dfly