diff options
author | David Storch <david.storch@10gen.com> | 2016-12-01 12:49:59 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-12-06 13:36:14 -0500 |
commit | 4e7fa3664849a4b8e26ea6606cf977b4a27a74dc (patch) | |
tree | f8f4dbf071c69f6e1955dcdbf17b4bc20ef075f9 /src/mongo/bson | |
parent | fa06d911194356baeb709bf68c36e52afa9a9968 (diff) | |
download | mongo-4e7fa3664849a4b8e26ea6606cf977b4a27a74dc.tar.gz |
SERVER-27200 fix CodeWScope comparison to not use collator
(cherry picked from commit 6bee18129c27a82ebcbd316c7900afb04c6f69dc)
Diffstat (limited to 'src/mongo/bson')
-rw-r--r-- | src/mongo/bson/bsonelement.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mongo/bson/bsonelement.cpp b/src/mongo/bson/bsonelement.cpp index 34b4b07576d..5131d5943ed 100644 --- a/src/mongo/bson/bsonelement.cpp +++ b/src/mongo/bson/bsonelement.cpp @@ -993,16 +993,10 @@ int compareElementValues(const BSONElement& l, if (cmp) return cmp; - return l.codeWScopeObject().woCompare( - // woCompare parameters: r, ordering, considerFieldName, comparator. - // r: the BSONObj to compare with. - // ordering: the sort directions for each key. - // considerFieldName: whether field names should be considered in comparison. - // comparator: used for all string comparisons, if non-null. - r.codeWScopeObject(), - BSONObj(), - true, - comparator); + // When comparing the scope object, we should consider field names. Special string + // comparison semantics do not apply to strings nested inside the CodeWScope scope + // object, so we do not pass through the string comparator. + return l.codeWScopeObject().woCompare(r.codeWScopeObject(), BSONObj(), true); } default: verify(false); |