Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-290

Problem with Query & hint (const string &jsonKeyPatt) with compound index in locale with comma as decimal point

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Implementation
    • Labels:
    • Environment:
      Windows 2008 - German OS

      Description

      We have compound indexes like this:

      {containerpath_idx:1,name_idx:1,ismanaged_idx:1}

      When we are in German locale and pass this as a string to this method:

      Query & hint (const string &jsonKeyPatt)

      it throws an exception (FailedToParse: Expecting '}' or ',') because the parse method in json.cpp uses strtod() to parse the numbers. In any locale that uses commas as decimal places the parsing does not work because strtod() strips the comma as part of the number.

      As a workaround we will use the hint() method that takes a BSON object.

      I'm not sure if there are other places where this will cause issues.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: