[SERVER-27197] Code BSON type should not be compared using a collation-aware string comparator 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: | Critical - P2 |
| 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: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Backport Completed: | |||||||||||||
| Sprint: | Query 2016-12-12 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
BSONElement::compareElementValues() can incorrectly use a collation-aware StringData comparator when comparing values of BSONType::Code: https://github.com/mongodb/mongo/blob/r3.4.0-rc5/src/mongo/bson/bsonelement.cpp#L945-L961 Only BSONType::String and possibly BSONType::Symbol (see related issue SERVER-27195) should ever make comparisons using a StringData comparator. As a consequence, queries involving Code values which have a non-simple collation may return the wrong data or may sort the data 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: (cherry picked from commit 6f1824c8ff3b211f72e706de32b9637750cccf1e) |
| 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: |