-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: Legacy C++ Implementation
-
Component/s: mongodump
-
None
-
Environment:Windows 10, mongod 2.6.3 (x64), mongodump 2.6.3 & 2.7.6
-
Platforms 2016-11-21
-
Needed
-
v2.6
The legacy C++ implementation seems to output directly to the C standard output stream stdout, without setting binary mode. On Windows, if the written data includes line-feed 0x0A (\n) bytes, they will get automatically prefixed with a carriage return character 0x0D (\r), resulting in extra bytes in the output.
To reproduce, have some documents in a mongo collection with data containing line feed characters e.g.:
{ "testfield" : "A\nB" }
open a command line prompt and run:
mongodump.exe --db mydb --collection mycollection --out testdump mongodump.exe --db mydb --collection mycollection --out - > testdump.bson
Then observe 1-byte size difference between the files testdump\mydb\mycollection.bson & testdump.bson and confirm that there is an extra 0x0D byte in the latter file.