[SERVER-2163] Mongo shell lets you switch to a database named "" Created: 30/Nov/10  Updated: 12/Jul/16  Resolved: 30/Nov/10

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

Type: Bug Priority: Major - P3
Reporter: Justin Dearing Assignee: Dwight Merriman
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows


Operating System: ALL
Participants:

 Description   

The shell will let you set the current database to "". Illustration below:

> use
switched to db
> db

> show collections
Tue Nov 30 17:33:48 uncaught exception: error:

{ "$err" : "db name can't be empty", "code" : 13075 }

The use command without a parameter should display an error and not change the current database.



 Comments   
Comment by auto [ 30/Nov/10 ]

Author:

{'login': 'dwight', 'name': 'Dwight', 'email': 'dwight@10gen.com'}

Message: SERVER-2163
/mongodb/mongo/commit/64bc8df4af845a2d43ecda91049986c49de8bade

Generated at Thu Feb 08 02:59:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.