[SERVER-50061] mongo::sbe::bson::convertFrom assumes Decimal128 values are in machine order Created: 31/Jul/20  Updated: 29/Oct/23  Resolved: 11/Aug/20

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

Type: Bug Priority: Major - P3
Reporter: Justin Seyster Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2020-08-24
Participants:
Linked BF Score: 0

 Comments   
Comment by Githook User [ 11/Aug/20 ]

Author:

{'name': 'Justin Seyster', 'email': 'justin.seyster@mongodb.com', 'username': 'jseyster'}

Message: SERVER-50061 convertFrom() assumes NumberDecimal has machine byte order
Branch: master
https://github.com/mongodb/mongo/commit/3fa96565dd15093a15e6cdebce47cc4464bca0ff

Comment by Andrew Morrow (Inactive) [ 31/Jul/20 ]

There also appears to be sbe::value::readFromMemory and sbe::value::writeFromMemory, which appear to be more or less duplicates of what the Data* types provide.

Comment by Justin Seyster [ 31/Jul/20 ]

acm Agreed. As far as I can tell, we just missed one spot:
https://github.com/mongodb/mongo/blob/134c3ee37576de7ec36456fe3420305d6871b874/src/mongo/db/exec/sbe/values/bson.cpp#L106

I have a proposed solution, though, that ensures we use ConstDataView for that case as well that I will be uploading for code review as soon as I get a patch build back to verify that it actually fixes the problem on s390x.

Generated at Thu Feb 08 05:21:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.