summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/pipeline_command.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2022-10-27 04:31:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-10-27 16:59:12 +0000
commit6fc0fceb929a37f34882b52bdc59a5c3aa63716f (patch)
tree5640ae3721f195af4366a4ab8967652f26166e2b /src/mongo/db/commands/pipeline_command.cpp
parent734191d9d0c5225ec4ca9309068cf3c04c445c74 (diff)
downloadmongo-6fc0fceb929a37f34882b52bdc59a5c3aa63716f.tar.gz
SERVER-70053 Serialize and deserialize DatabaseName correctly in multitenancy mode
Diffstat (limited to 'src/mongo/db/commands/pipeline_command.cpp')
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index 8b6129b9b6f..b2fb0341568 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -47,6 +47,7 @@
#include "mongo/db/query/query_knobs_gen.h"
#include "mongo/idl/idl_parser.h"
#include "mongo/stdx/unordered_set.h"
+#include "mongo/util/database_name_util.h"
namespace mongo {
namespace {
@@ -84,7 +85,8 @@ public:
boost::optional<ExplainOptions::Verbosity> explainVerbosity) override {
const auto aggregationRequest = aggregation_request_helper::parseFromBSON(
opCtx,
- DatabaseName(opMsgRequest.getValidatedTenantId(), opMsgRequest.getDatabase()),
+ DatabaseNameUtil::deserialize(opMsgRequest.getValidatedTenantId(),
+ opMsgRequest.getDatabase()),
opMsgRequest.body,
explainVerbosity,
APIParameters::get(opCtx).getAPIStrict().value_or(false));
@@ -119,7 +121,8 @@ public:
PrivilegeVector privileges)
: CommandInvocation(cmd),
_request(request),
- _dbName(request.getValidatedTenantId(), request.getDatabase()),
+ _dbName(DatabaseNameUtil::deserialize(request.getValidatedTenantId(),
+ request.getDatabase())),
_aggregationRequest(std::move(aggregationRequest)),
_liteParsedPipeline(_aggregationRequest),
_privileges(std::move(privileges)) {