[CXX-290] Problem with Query & hint (const string &jsonKeyPatt) with compound index in locale with comma as decimal point Created: 24/Jul/13  Updated: 07/Jan/15  Resolved: 07/Jan/15

Status: Closed
Project: C++ Driver
Component/s: Implementation
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Paul Judson Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 2008 - German OS


Issue Links:
Related
is related to SERVER-1920 Sort by collation Closed

 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.



 Comments   
Comment by Adam Midvidy [ 07/Jan/15 ]

The driver requires the C locale. We do not plan to change that at this time.

Generated at Wed Feb 07 21:58:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.