0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00

handle edge case

This commit is contained in:
Eliot Horowitz 2009-11-07 21:00:15 -05:00
parent dfda4ccc39
commit d0d19f97cf

View File

@ -149,8 +149,10 @@ namespace mongo {
if ( finalLong != tempLong ){
dblock l;
db.dropCollection( finalLong );
BSONObj info;
uassert( "rename failed" , db.runCommand( "admin" , BSON( "renameCollection" << tempLong << "to" << finalLong ) , info ) );
if ( db.count( tempLong ) ){
BSONObj info;
uassert( "rename failed" , db.runCommand( "admin" , BSON( "renameCollection" << tempLong << "to" << finalLong ) , info ) );
}
}
return db.count( finalLong );
}