summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/pipeline_command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/pipeline_command.cpp')
-rw-r--r--src/mongo/db/commands/pipeline_command.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp
index 0ae4f12ebe0..ed6ee3323c2 100644
--- a/src/mongo/db/commands/pipeline_command.cpp
+++ b/src/mongo/db/commands/pipeline_command.cpp
@@ -245,16 +245,25 @@ namespace mongo {
auto_ptr<WorkingSet> ws(new WorkingSet());
auto_ptr<PipelineProxyStage> proxy(
new PipelineProxyStage(pPipeline, input, ws.get()));
+ Status execStatus = Status::OK();
if (NULL == collection) {
- execHolder.reset(new PlanExecutor(txn, ws.release(), proxy.release(), ns));
+ execStatus = PlanExecutor::make(txn,
+ ws.release(),
+ proxy.release(),
+ ns,
+ PlanExecutor::YIELD_MANUAL,
+ &exec);
}
else {
- execHolder.reset(new PlanExecutor(txn,
- ws.release(),
- proxy.release(),
- collection));
+ execStatus = PlanExecutor::make(txn,
+ ws.release(),
+ proxy.release(),
+ collection,
+ PlanExecutor::YIELD_MANUAL,
+ &exec);
}
- exec = execHolder.get();
+ invariant(execStatus.isOK());
+ execHolder.reset(exec);
if (!collection && input) {
// If we don't have a collection, we won't be able to register any executors, so