From 470c14ed7543d62a2a76476e6522823316ec36d3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Thu, 27 Dec 2018 14:01:39 -0500 Subject: SERVER-38038 mongo shell should support all ErrorExtraInfo codes (cherry picked from commit 33c750267b6481c0d0320d75c94ef755f3e467fe) --- src/mongo/SConscript | 1 + src/mongo/db/pipeline/aggregation_request.cpp | 3 --- src/mongo/db/pipeline/aggregation_request.h | 3 ++- src/mongo/db/views/SConscript | 12 +++++++++++- src/mongo/shell/dbshell.cpp | 2 ++ 5 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mongo/SConscript b/src/mongo/SConscript index 4add4dabf69..e7259e563f7 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -523,6 +523,7 @@ if not has_option('noshell') and usemozjs: "db/server_options_core", "client/clientdriver_network", "$BUILD_DIR/mongo/util/password", + "$BUILD_DIR/mongo/db/views/resolved_view", ], LIBDEPS_PRIVATE=[ "$BUILD_DIR/mongo/client/connection_string", diff --git a/src/mongo/db/pipeline/aggregation_request.cpp b/src/mongo/db/pipeline/aggregation_request.cpp index 11b49f23dc0..7d213a6e084 100644 --- a/src/mongo/db/pipeline/aggregation_request.cpp +++ b/src/mongo/db/pipeline/aggregation_request.cpp @@ -65,9 +65,6 @@ constexpr StringData AggregationRequest::kCommentName; constexpr long long AggregationRequest::kDefaultBatchSize; -AggregationRequest::AggregationRequest(NamespaceString nss, std::vector pipeline) - : _nss(std::move(nss)), _pipeline(std::move(pipeline)), _batchSize(kDefaultBatchSize) {} - StatusWith> AggregationRequest::parsePipelineFromBSON( BSONElement pipelineElem) { std::vector pipeline; diff --git a/src/mongo/db/pipeline/aggregation_request.h b/src/mongo/db/pipeline/aggregation_request.h index 7ef23b8734b..4f336461e55 100644 --- a/src/mongo/db/pipeline/aggregation_request.h +++ b/src/mongo/db/pipeline/aggregation_request.h @@ -104,7 +104,8 @@ public: * Constructs an AggregationRequest over the given namespace with the given pipeline. All * options aside from the pipeline assume their default values. */ - AggregationRequest(NamespaceString nss, std::vector pipeline); + AggregationRequest(NamespaceString nss, std::vector pipeline) + : _nss(std::move(nss)), _pipeline(std::move(pipeline)), _batchSize(kDefaultBatchSize) {} /** * Serializes the options to a Document. Note that this serialization includes the original diff --git a/src/mongo/db/views/SConscript b/src/mongo/db/views/SConscript index 8024e68c649..315fd179c1d 100644 --- a/src/mongo/db/views/SConscript +++ b/src/mongo/db/views/SConscript @@ -21,9 +21,9 @@ env.Library( 'view.cpp', 'view_catalog.cpp', 'view_graph.cpp', - 'resolved_view.cpp', ], LIBDEPS=[ + 'resolved_view', '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/db/server_parameters', '$BUILD_DIR/mongo/db/pipeline/aggregation', @@ -32,6 +32,16 @@ env.Library( ] ) +env.Library( + target='resolved_view', + source=[ + 'resolved_view.cpp', + ], + LIBDEPS=[ + '$BUILD_DIR/mongo/base', + ] +) + env.CppUnitTest( target='views_test', source=[ diff --git a/src/mongo/shell/dbshell.cpp b/src/mongo/shell/dbshell.cpp index 3fc5b2c69b5..8283793328b 100644 --- a/src/mongo/shell/dbshell.cpp +++ b/src/mongo/shell/dbshell.cpp @@ -765,6 +765,8 @@ int _main(int argc, char* argv[], char** envp) { // hide password from ps output redactPasswordOptions(argc, argv); + ErrorExtraInfo::invariantHaveAllParsers(); + if (!mongo::serverGlobalParams.quiet.load()) cout << mongoShellVersion(VersionInfoInterface::instance()) << endl; -- cgit v1.2.1