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

cleaner drop debugging

This commit is contained in:
Eliot Horowitz 2009-08-06 11:54:30 -04:00
parent 3578c9a207
commit de9543ff4d
2 changed files with 4 additions and 2 deletions

View File

@ -515,7 +515,6 @@ namespace mongo {
if ( *name == '*' && name[1] == 0 ) {
log() << " d->nIndexes was " << d->nIndexes << '\n';
anObjBuilder.append("nIndexesWas", (double)d->nIndexes);
anObjBuilder.append("msg", "all indexes deleted for collection");
IndexDetails *idIndex = 0;
if( d->nIndexes ) {
for ( int i = 0; i < d->nIndexes; i++ ) {
@ -533,6 +532,7 @@ namespace mongo {
}
/* assuming here that id index is not multikey: */
d->multiKeyIndexBits = 0;
anObjBuilder.append("msg", "all indexes deleted for collection");
}
else {
// delete just one index

View File

@ -565,7 +565,7 @@ assert( !eloc.isNull() );
/* drop a collection/namespace */
void dropNS(const string& nsToDrop) {
NamespaceDetails* d = nsdetails(nsToDrop.c_str());
uassert( "ns not found", d );
uassert( (string)"ns not found: " + nsToDrop , d );
uassert( "can't drop system ns", strstr(nsToDrop.c_str(), ".system.") == 0 );
{
@ -607,6 +607,7 @@ assert( !eloc.isNull() );
}
void dropCollection( const string &name, string &errmsg, BSONObjBuilder &result ) {
log(1) << "dropCollection: " << name << endl;
NamespaceDetails *d = nsdetails(name.c_str());
assert( d );
if ( d->nIndexes != 0 ) {
@ -618,6 +619,7 @@ assert( !eloc.isNull() );
}
assert( d->nIndexes == 0 );
}
log(1) << "\t deleteIndexes dones" << endl;
result.append("ns", name.c_str());
ClientCursor::invalidate(name.c_str());
dropNS(name);