summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-03-09 10:24:11 -0800
committerAaron <aaron@10gen.com>2010-03-09 10:24:11 -0800
commitdee49ac08054969d23fc969a67e20324af134d36 (patch)
tree41b2b25a45a99bb45d18a2da6871c86b6c4035c0
parentbec48b040a12864ec893157bcffe5d2702fcd3f4 (diff)
downloadmongo-dee49ac08054969d23fc969a67e20324af134d36.tar.gz
SERVER-705 merge
-rw-r--r--db/dbcommands.cpp5
-rw-r--r--util/goodies.h9
2 files changed, 11 insertions, 3 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index b0a7cdd6273..179e5bbf774 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1291,7 +1291,6 @@ namespace mongo {
virtual bool slaveOk() {
return false;
}
- virtual LockType locktype() { return WRITE; }
virtual bool requiresAuth() {
return true;
}
@@ -1300,8 +1299,8 @@ namespace mongo {
}
virtual bool run(const char *dbname, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool) {
string coll = cmdObj[ "godinsert" ].valuestrsafe();
- uassert( 13049, "godinsert must specify a collection", !coll.empty() );
- string ns = nsToDatabase( dbname ) + "." + coll;
+ uassert( "godinsert must specify a collection", !coll.empty() );
+ string ns = nsToClient( dbname ) + "." + coll;
BSONObj obj = cmdObj[ "obj" ].embeddedObjectUserCheck();
DiskLoc loc = theDataFileMgr.insert( ns.c_str(), obj, true );
return true;
diff --git a/util/goodies.h b/util/goodies.h
index f366107a4e3..88807c81754 100644
--- a/util/goodies.h
+++ b/util/goodies.h
@@ -242,6 +242,15 @@ namespace mongo {
return (xt.sec & 0xfffff) * 1000 + t;
}
+ struct Date_t {
+ // TODO: make signed (and look for related TODO's)
+ unsigned long long millis;
+ Date_t(): millis(0) {}
+ Date_t(unsigned long long m): millis(m) {}
+ operator unsigned long long&() { return millis; }
+ operator const unsigned long long&() const { return millis; }
+ };
+
inline unsigned long long jsTime() {
boost::xtime xt;
boost::xtime_get(&xt, boost::TIME_UTC);