diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-04-26 15:06:23 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-04-27 13:19:24 -0400 |
commit | eec194e751f6c36e53c241da3a1b42fd4b9b98a1 (patch) | |
tree | 6ba88aac4aba6ba218d1e92be5e84aa514fb1a69 /src/mongo/db/commands/pipeline_command.cpp | |
parent | 2df6ea3c5b70acc3927a08690f8d42b9d35b8709 (diff) | |
download | mongo-eec194e751f6c36e53c241da3a1b42fd4b9b98a1.tar.gz |
SERVER-28983 Fix undefined behaviour for the 'aggregate' command
Diffstat (limited to 'src/mongo/db/commands/pipeline_command.cpp')
-rw-r--r-- | src/mongo/db/commands/pipeline_command.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index af863000b60..fcfb1156b7f 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -28,7 +28,6 @@ #include "mongo/platform/basic.h" -#include "mongo/base/init.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/auth/privilege.h" #include "mongo/db/client.h" @@ -50,8 +49,7 @@ bool isMergePipeline(const std::vector<BSONObj>& pipeline) { class PipelineCommand : public Command { public: - PipelineCommand() - : Command(AggregationRequest::kCommandName) {} // command is called "aggregate" + PipelineCommand() : Command("aggregate", false) {} // Locks are managed manually, in particular by DocumentSourceCursor. virtual bool supportsWriteConcern(const BSONObj& cmd) const override { @@ -152,13 +150,8 @@ public: return runAggregate(opCtx, nss, request.getValue(), cmdObj, *out); } -}; -MONGO_INITIALIZER(PipelineCommand)(InitializerContext* context) { - new PipelineCommand(); - - return Status::OK(); -} +} pipelineCmd; } // namespace } // namespace mongo |