[SERVER-27200] Comparison of the scope object in a BSON element of type CodeWScope should not respect the collation Created: 28/Nov/16  Updated: 05/Apr/17  Resolved: 06/Dec/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.4.1, 3.5.1

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-27195 Symbol BSON type compares incorrectly... Backlog
is related to SERVER-27197 Code BSON type should not be compared... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Query 2016-12-12
Participants:

 Description   

When we compare the nested object representing the JavaScript scope in an element of BSONType::CodeWScope, we pass through the StringData comparator:

https://github.com/mongodb/mongo/blob/r3.4.0-rc5/src/mongo/bson/bsonelement.cpp#L1005

This is incorrect, since only BSONType::String, or String nested inside Object or Array, should ever use custom string comparison semantics. This means that queries may compare CodeWScope elements incorrectly.



 Comments   
Comment by Githook User [ 06/Dec/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-27200 fix CodeWScope comparison to not use collator

(cherry picked from commit 6bee18129c27a82ebcbd316c7900afb04c6f69dc)
Branch: v3.4
https://github.com/mongodb/mongo/commit/4e7fa3664849a4b8e26ea6606cf977b4a27a74dc

Comment by Githook User [ 06/Dec/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-27200 fix CodeWScope comparison to not use collator
Branch: master
https://github.com/mongodb/mongo/commit/6bee18129c27a82ebcbd316c7900afb04c6f69dc

Generated at Thu Feb 08 04:14:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.