[SERVER-8541] BinData80 bin data type not parsed correctly by JSON to BSON parser Created: 12/Feb/13  Updated: 15/Feb/13  Resolved: 12/Feb/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Andrew Emil (Inactive) Assignee: Shaun Verch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-8493 jsonString Sign Extends Bindata Type Closed
Related
Operating System: ALL
Steps To Reproduce:

Add the following test to jsontests.cpp

class BinData80 : public Base {
virtual BSONObj bson() const

{ char z[ 3 ]; z[ 0 ] = 'a'; z[ 1 ] = 'b'; z[ 2 ] = 'c'; BSONObjBuilder b; b.appendBinData( "a", 3, bdtCustom, z ); return b.obj(); }

virtual string json() const {
return "{ \"a\" :

{ \"$binary\" : \"YWJj\", \"$type\" : \"80\" }

}";
}
};

and you get the error

JsonTests::FromJsonTests::BinData80 std::exception: code FailedToParse: FailedToParse: Argument of $type in $bindata object must be a hex string representation of a single byte: offset:50 in test JsonTests::FromJsonTests::BinData80

Participants:
Generated at Thu Feb 08 03:17:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.