-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.2.0-rc0
-
Component/s: MapReduce
-
None
-
ALL
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
If you insert invalid UTF-16 text into a string and save it in MongoDB, the database will happily store it, but if you try to run mapReduce() on it, you'll get one of the following two errors:
map reduce failed:{
"errmsg" : "exception: map invoke failed: JS Error: InternalError: buffer too small (anon):1",
"code" : 9014,
"ok" : 0
}
map reduce failed:{
"errmsg" : "exception: map invoke failed: JS Error: TypeError: bad surrogate character 0x61 (anon):1",
"code" : 9014,
"ok" : 0
}
Suggested fixes:
- Change MongoDB to not accept broken UTF-16 surrogate pairs
- Print a more informative error message when encountering this
Reproducable test case attached