Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27197

Code BSON type should not be compared using a collation-aware string comparator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.1, 3.5.1
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Completed:
    • Sprint:
      Query 2016-12-12

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: