summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorDavid Hatch <david.hatch@mongodb.com>2016-06-17 18:00:37 -0400
committerDavid Hatch <david.hatch@mongodb.com>2016-06-21 14:48:46 -0400
commit679ddbe910fd27634f855e245e1bcb2021b28e61 (patch)
tree94015a6b07835e8ff8835747fe01740b35fed5ea /src/mongo/db/query
parent8900241bf9559d4d5afa35fb8dc77ad4e05bba9b (diff)
downloadmongo-679ddbe910fd27634f855e245e1bcb2021b28e61.tar.gz
SERVER-24644 $min/$max update operators respect collation.
Collection default collation is correctly propagated to modifier operations.
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/get_executor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index 9f5f2626c9f..4258c1f9ab9 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -837,6 +837,13 @@ StatusWith<unique_ptr<PlanExecutor>> getExecutorUpdate(OperationContext* txn,
invariant(request->isExplain());
}
+ // If the parsed update does not have a user-specified collation, set it from the collection
+ // default.
+ if (collection && parsedUpdate->getRequest()->getCollation().isEmpty() &&
+ collection->getDefaultCollator()) {
+ parsedUpdate->setCollator(collection->getDefaultCollator()->clone());
+ }
+
// TODO: This seems a bit circuitious.
if (opDebug) {
opDebug->updateobj = request->getUpdates();