Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix drop fallout

  • Loading branch information...
commit 76d849e09077d1b3dbd5cad3fe296ca06e91119f 1 parent f6d0668
@erh erh authored
View
2  jstests/basic1.js
@@ -1,6 +1,6 @@
t = db.getCollection( "basic1" );
-assert( t.drop() );
+t.drop();
o = { a : 1 };
t.save( o );
View
6 jstests/indexd.js
@@ -4,9 +4,7 @@ t.drop();
t.save( { a : 1 } );
t.ensureIndex( { a : 1 } );
-db.indexd.$_id_.drop();
-r = t.drop();
-assert.eq( 1 , r.ok , "drop failed: " + tojson( r ) );
-
+assert.throws( function(){ db.indexd.$_id_.drop(); } );
+assert( t.drop() );
//db.indexd.$_id_.remove({});
View
3  jstests/profile1.js
@@ -14,8 +14,7 @@ assert.gt(capped_size, 999, "D");
assert.lt(capped_size, 2000, "E");
/* Make sure we can't drop if profiling is still on */
-db.getCollection("system.profile").drop();
-assert(db.getLastError(), "Y");
+assert.throws( function(z){ db.getCollection("system.profile").drop(); } )
/* With pre-created system.profile (un-capped) */
db.runCommand({profile: 0});
View
6 shell/collection.js
@@ -296,8 +296,12 @@ DBCollection.prototype.dropIndexes = function(){
DBCollection.prototype.drop = function(){
this.resetIndexCache();
var ret = this._db.runCommand( { drop: this.getName() } );
- if ( ! ret.ok )
+ if ( ! ret.ok ){
+ if ( ret.errmsg == "ns not found" )
+ return false;
throw "drop failed: " + tojson( ret );
+ }
+ return true;
}
DBCollection.prototype.renameCollection = function( newName ){
Please sign in to comment.
Something went wrong with that request. Please try again.