[SERVER-5020] Mongo shell should check the validity of the db name for "use <dbname"> Created: 20/Feb/12  Updated: 11/Jul/16  Resolved: 01/Mar/12

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

Type: Bug Priority: Minor - P4
Reporter: Andreas Jung Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

> use bash.org
switched to db bash.org
> db.quotes.save(

{x:"hi"}

);
Mon Feb 20 08:25:25 uncaught exception: error

{ "$err" : "bad or malformed command request?", "code" : 13530 }

The "use" command should check if the database name is a valid name otherwise further commands will raise errors that are not directly related to the real problem (n00b confusion).



 Comments   
Comment by auto [ 01/Mar/12 ]

Author:

{u'login': u'', u'name': u'Randolph Tan', u'email': u'ren@Randolphs-MacBook-Air.local'}

Message: SERVER-5020 Mongo shell should check the validity of the db name for use dbname

No automated test for actually using "use" since the shell cannot parse it correctly when "use" is placed inside a function and assert.throws requires you to pass a function to it. Tested ok on SpiderMonkey and V8 by hand.
Branch: master
https://github.com/mongodb/mongo/commit/caf6045dd9ec2d4e093a2c2790910eb9ca7900a6

Comment by auto [ 01/Mar/12 ]

Author:

{u'login': u'', u'name': u'Randolph Tan', u'email': u'ren@Randolphs-MacBook-Air.local'}

Message: SERVER-5020 Mongo shell should check the validity of the db name for use dbname

No automated test for actually using "use" since the shell cannot parse it correctly when "use" is placed inside a function and assert.throws requires you to pass a function to it. Tested ok on SpiderMonkey and V8 by hand.
Branch: SERVER-5020
https://github.com/mongodb/mongo/commit/caf6045dd9ec2d4e093a2c2790910eb9ca7900a6

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