Fix test failures resulting from trying to query DB in tools that don't use a
specific collection (dump/restore).
This commit is contained in:
@@ -383,7 +383,10 @@ namespace mongo {
|
||||
if ( ! ( _username.size() || _password.size() ) ) {
|
||||
// Make sure that we don't need authentication to connect to this db
|
||||
// findOne throws an AssertionException if it's not authenticated.
|
||||
conn().findOne(getNS(), Query("{}"));
|
||||
if (_coll.size() > 0) {
|
||||
// BSONTools don't have a collection
|
||||
conn().findOne(getNS(), Query("{}"));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user