[SERVER-74844] Reinterpreting script in module mode corrupts the source string data Created: 14/Mar/23  Updated: 29/Oct/23  Resolved: 15/Mar/23

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

Type: Bug Priority: Major - P3
Reporter: Matt Broadstone Assignee: Matt Broadstone
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

An optimization introduced in SERVER-70553 attempts avoid re-reading a file from disk if we need to reinterpret the source as a module. Since the code stores the data in a standard JSString, it will corrupt the input UTF8 data and prevent accurate round-tripping of some characters. The fix is to store the data in a wide UCString (similar to how we store it when reading from the file in the ModuleLoader::fileAsString method)



 Comments   
Comment by Githook User [ 15/Mar/23 ]

Author:

{'name': 'Matt Broadstone', 'email': 'mbroadst@mongodb.com', 'username': 'mbroadst'}

Message: SERVER-74844 Store parsed source text in wide string
Branch: master
https://github.com/mongodb/mongo/commit/611d638fd33f727849e6f47722c519e836c91cc2

Generated at Thu Feb 08 06:28:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.