From cbe2d992e9cd1ea66af9fa91df006106775d3073 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Tue, 23 Aug 2011 08:47:17 +0200 Subject: Imported Upstream version 1.8.3 --- db/dbcommands.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'db/dbcommands.cpp') diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp index cf0857a..59dd78c 100644 --- a/db/dbcommands.cpp +++ b/db/dbcommands.cpp @@ -851,6 +851,17 @@ namespace mongo { for ( list::iterator i=all.begin(); i!=all.end(); i++ ) { BSONObj o = *i; + if ( o.getIntField("v") > 0 ) { + BSONObjBuilder b; + BSONObjIterator i( o ); + while ( i.more() ) { + BSONElement e = i.next(); + if ( str::equals( e.fieldName() , "v" ) ) + continue; + b.append( e ); + } + o = b.obj(); + } theDataFileMgr.insertWithObjMod( Namespace( toDeleteNs.c_str() ).getSisterNS( "system.indexes" ).c_str() , o , true ); } @@ -1753,6 +1764,7 @@ namespace mongo { } if ( cmdObj["help"].trueValue() ) { + client.curop()->ensureStarted(); stringstream ss; ss << "help for: " << c->name << " "; c->help( ss ); @@ -1777,6 +1789,7 @@ namespace mongo { if ( c->locktype() == Command::NONE ) { // we also trust that this won't crash + client.curop()->ensureStarted(); string errmsg; int ok = c->run( dbname , cmdObj , errmsg , result , fromRepl ); if ( ! ok ) @@ -1791,6 +1804,7 @@ namespace mongo { } mongolock lk( needWriteLock ); + client.curop()->ensureStarted(); Client::Context ctx( dbname , dbpath , &lk , c->requiresAuth() ); try { @@ -1824,7 +1838,6 @@ namespace mongo { returns true if ran a cmd */ bool _runCommands(const char *ns, BSONObj& _cmdobj, BufBuilder &b, BSONObjBuilder& anObjBuilder, bool fromRepl, int queryOptions) { - cc().curop()->ensureStarted(); string dbname = nsToDatabase( ns ); if( logLevel >= 1 ) -- cgit v1.2.3