summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-05-26 11:11:10 -0400
committerEliot Horowitz <eliot@10gen.com>2010-05-26 11:11:10 -0400
commitc00f9ebe0213fd2163d130c60cdfb43ebb65d5d8 (patch)
tree7d1970cf8b8a83f6fadb2ec19730733e55e14fcb
parent11e54f988ee7a6b179a4c51b8a5cfc5d8fabdbb8 (diff)
downloadmongo-c00f9ebe0213fd2163d130c60cdfb43ebb65d5d8.tar.gz
safey
-rw-r--r--db/dbcommands.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index fc3f55b3cce..bbb0f2f3cde 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1833,6 +1833,7 @@ 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 )
@@ -1859,6 +1860,7 @@ namespace mongo {
BSONElement e = jsobj.firstElement();
Command * c = e.type() ? Command::findCommand( e.fieldName() ) : 0;
+
if ( c ){
ok = execCommand( c , client , queryOptions , ns , jsobj , anObjBuilder , fromRepl );
}
@@ -1866,10 +1868,12 @@ namespace mongo {
anObjBuilder.append("errmsg", "no such cmd");
anObjBuilder.append("bad cmd" , _cmdobj );
}
+
anObjBuilder.append("ok", ok);
BSONObj x = anObjBuilder.done();
b.append((void*) x.objdata(), x.objsize());
+
return true;
}
-
+
} // namespace mongo