1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00

fix: crash with NS in multi/exec #3410 (#3415)

This commit is contained in:
Borys 2024-07-31 13:06:32 +03:00 committed by GitHub
parent 1aa0720843
commit 558a22d5b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View file

@ -103,6 +103,7 @@ ConnectionContext::ConnectionContext(const ConnectionContext* owner, Transaction
acl_commands = owner->acl_commands;
keys = owner->keys;
skip_acl_validation = owner->skip_acl_validation;
ns = owner->ns;
} else {
acl_commands = std::vector<uint64_t>(acl::NumberOfFamilies(), acl::NONE_COMMANDS);
}

View file

@ -1106,4 +1106,17 @@ TEST_F(MultiEvalTest, MultiAndEval) {
EXPECT_EQ(resp, "OK");
}
TEST_F(MultiTest, MultiTypes) {
// we had a bug with namespaces for type command in multi/exec
EXPECT_THAT(Run({"multi"}), "OK");
EXPECT_THAT(Run({"type", "sdfx3"}), "QUEUED");
EXPECT_THAT(Run({"type", "asdasd2"}), "QUEUED");
EXPECT_THAT(Run({"type", "wer124"}), "QUEUED");
EXPECT_THAT(Run({"type", "asafdasd"}), "QUEUED");
EXPECT_THAT(Run({"type", "dsfgser"}), "QUEUED");
EXPECT_THAT(Run({"type", "erg2"}), "QUEUED");
EXPECT_THAT(Run({"exec"}),
RespArray(ElementsAre("none", "none", "none", "none", "none", "none")));
}
} // namespace dfly