[SERVER-7014] Shell doesn't parse invalid keys correctly Created: 11/Sep/12  Updated: 15/Feb/13  Resolved: 13/Feb/13

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

Type: Bug Priority: Major - P3
Reporter: Kristina Chodorow (Inactive) Assignee: Shaun Verch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

MongoDB shell version: 2.2.0
connecting to: test
> db.test.remove()
> db.test.insert({ "name" : "no admin 2", "isadmin" : false})
> db.test.find()
{ "_id" : ObjectId("504f883dbc114eb55c6387af"), "name" : "no admin 2", "isadmin" : false }
> db.test.insert({ "name\x16\x00\x08isadmin\x00\x01\x00\x00\x00\x00\x00" : "no admin 2", "isadmin" : false })
> db.test.find()
{ "_id" : ObjectId("504f883dbc114eb55c6387af"), "name" : "no admin 2", "isadmin" : false }
{ "_id" : ObjectId("504f8843bc114eb55c6387b0"), "name" : null, "isadmin" : true, "isadmin" : true }



 Comments   
Comment by Eric Milkie [ 13/Feb/13 ]

This was fixed in 2.3.2 by SERVER-7769

Comment by Joel Westberg [ 09/Dec/12 ]

Please consider SERVER-7691 (which was closed as dupe) when resolving this, so the issue of NUL is looked at in its larger context. Some simple input checking in the shell will not resolve the issue in it's entirety.

Comment by Kristina Chodorow (Inactive) [ 11/Sep/12 ]

It should throw an exception, not insert the document anyway.

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