diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2018-03-05 15:48:48 -0500 |
---|---|---|
committer | Billy Donahue <billy.donahue@mongodb.com> | 2018-03-06 10:04:53 -0500 |
commit | e3a3f54a6c0ec4f471e0aff7a48b8a30f8c0e9cb (patch) | |
tree | 9c2f4ac5a4d8751336397c8af59a08bf78f1c201 /src/mongo/db/commands/mr_test.cpp | |
parent | 5dfa372b25b1a26bb12e09fdb029ff219b0f5343 (diff) | |
download | mongo-e3a3f54a6c0ec4f471e0aff7a48b8a30f8c0e9cb.tar.gz |
SERVER-33065 CommandReplyBuilder and CommandInvocation
Revert "Revert "SERVER-33065 CommandReplyBuilder and CommandInvocation""
This reverts commit 74177edb35b6ce7594e4751051010ceade592484.
Leave out the unintentional repl/ change this time.
Diffstat (limited to 'src/mongo/db/commands/mr_test.cpp')
-rw-r--r-- | src/mongo/db/commands/mr_test.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/commands/mr_test.cpp b/src/mongo/db/commands/mr_test.cpp index 068699d88b3..8541e5f3f74 100644 --- a/src/mongo/db/commands/mr_test.cpp +++ b/src/mongo/db/commands/mr_test.cpp @@ -423,11 +423,11 @@ Status MapReduceCommandTest::_runCommand(StringData mapCode, StringData reduceCo ASSERT(command) << "Unable to look up mapReduce command"; auto request = OpMsgRequest::fromDBAndBody(inputNss.db(), _makeCmdObj(mapCode, reduceCode)); - BSONObjBuilder result; - auto success = command->publicRun(_opCtx.get(), request, result); - if (!success) { - auto status = getStatusFromCommandResult(result.obj()); - ASSERT_NOT_OK(status); + BufBuilder bb; + CommandReplyBuilder crb(BSONObjBuilder{bb}); + command->parse(_opCtx.get(), request)->run(_opCtx.get(), &crb); + auto status = getStatusFromCommandResult(crb.getBodyBuilder().asTempObj()); + if (!status.isOK()) { return status.withContext(str::stream() << "mapReduce command failed: " << request.body); } |