[SERVER-6646] Strings with NUL bytes don't round-trip correctly from BSON <-> JavaScript Created: 30/Jul/12  Updated: 11/Jul/16  Resolved: 24/Apr/13

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 2.4.5, 2.5.0

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-3614 strings with embedded nulls cannot be... Closed
is duplicated by SERVER-6556 aggregation Value does not handle str... Closed
is duplicated by SERVER-5462 Shell doesn't handle embedded nulls c... Closed
is duplicated by SERVER-12756 Mongo shell not handling \u0000 corre... Closed
Related
is related to SERVER-2407 Switch to v8 Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Participants:

 Description   

SpiderMonkey: JS -> BSON is correct, but not BSON -> JS
V8: I think both are broken

See v8 build failure at http://buildlogs.mongodb.org/build/5016c861d2a60f1068000491/test/5016c87dd2a60f1326000417/

That test passes on SM but this fails:

> db.foo.drop()
true
> db.foo.insert({key:'adsf\0asdf'})
> db.foo.findOne()
{ "_id" : ObjectId("5016cec9eee3e47040cf29dd"), "key" : "adsf" }

Note that it is written to the db correctly and readable by pymongo:

In [5]: db.foo.find_one()
Out[5]: {'_id': ObjectId('5016cec9eee3e47040cf29dd'), 'key': 'adsf\x00asdf'}



 Comments   
Comment by auto [ 24/Apr/13 ]

Author:

{u'date': u'2013-04-10T22:40:56Z', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}

Message: SERVER-6646 Fix more issues round-tripping V8 Strings with NUL bytes
Branch: master
https://github.com/mongodb/mongo/commit/6cea3cbbca67f682d16b93a50f9a90a4b7f2b405

Comment by auto [ 13/Mar/13 ]

Author:

{u'date': u'2013-03-13T22:02:33Z', u'name': u'Ben Becker', u'email': u'ben.becker@10gen.com'}

Message: SERVER-6646: fix spidermonkey build
Branch: master
https://github.com/mongodb/mongo/commit/5ce51596e587523136473c7bf7bbc10d23f135e3

Comment by auto [ 13/Mar/13 ]

Author:

{u'date': u'2013-03-13T20:02:27Z', u'name': u'Ben Becker', u'email': u'ben.becker@10gen.com'}

Message: SERVER-6646: fix round-trip of null values in v8
Branch: master
https://github.com/mongodb/mongo/commit/7e33eb759679ca0693caaec8c1b12cd394a7285b

Comment by auto [ 03/Aug/12 ]

Author:

{u'date': u'2012-08-03T09:35:18-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: Disable test for SERVER-6556 on V8 due to SERVER-6646
Branch: master
https://github.com/mongodb/mongo/commit/a1382fdb96bd73e525d6f5499efc31456c07827a

Comment by Aaron Staple [ 30/Jul/12 ]

Potentially related:

SERVER-3614
SERVER-5462

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