summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/parsed_update.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-09-01 15:35:29 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-09-07 10:22:13 -0400
commit56e12d84796799bfb85ade5c02f40d49cffd1b84 (patch)
tree9d2ce8a0406d8ad2e554007fbdce971b08372bd3 /src/mongo/db/ops/parsed_update.cpp
parent2576c69fbb31b7b4c67ac8835fc2a5f6d405ce8a (diff)
downloadmongo-56e12d84796799bfb85ade5c02f40d49cffd1b84.tar.gz
SERVER-25742 Disallow per-op collation when featureCompatibilityVersion=3.2
Diffstat (limited to 'src/mongo/db/ops/parsed_update.cpp')
-rw-r--r--src/mongo/db/ops/parsed_update.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/ops/parsed_update.cpp b/src/mongo/db/ops/parsed_update.cpp
index aea37881858..d7fe607a855 100644
--- a/src/mongo/db/ops/parsed_update.cpp
+++ b/src/mongo/db/ops/parsed_update.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/query/canonical_query.h"
#include "mongo/db/query/collation/collator_factory_interface.h"
#include "mongo/db/query/query_planner_common.h"
+#include "mongo/db/server_options.h"
namespace mongo {
@@ -51,6 +52,13 @@ Status ParsedUpdate::parseRequest() {
invariant(_request->getProj().isEmpty() || _request->shouldReturnAnyDocs());
if (!_request->getCollation().isEmpty()) {
+ if (serverGlobalParams.featureCompatibilityVersion.load() ==
+ ServerGlobalParams::FeatureCompatibilityVersion_32) {
+ return Status(ErrorCodes::InvalidOptions,
+ "The featureCompatibilityVersion must be 3.4 to use collation. See "
+ "http://dochub.mongodb.org/core/3.4-feature-compatibility.");
+ }
+
auto collator = CollatorFactoryInterface::get(_txn->getServiceContext())
->makeFromBSON(_request->getCollation());
if (!collator.isOK()) {