summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-07-23 18:09:53 -0400
committerDwight <dmerriman@gmail.com>2008-07-23 18:09:53 -0400
commitfa1bbbc78a382dd57f476f82c9f4ee7e83c7d531 (patch)
treecf000cb18124068ae67aee97c7bfb13927a68ed0
parent5f9bdedf081e33b43b616214e9dc1a45ae2fa9e6 (diff)
downloadmongo-fa1bbbc78a382dd57f476f82c9f4ee7e83c7d531.tar.gz
defensive / better logging / minor
-rw-r--r--db/jsobj.h1
-rw-r--r--db/pdfile.cpp2
-rw-r--r--db/query.cpp1
3 files changed, 3 insertions, 1 deletions
diff --git a/db/jsobj.h b/db/jsobj.h
index 5415c75f861..152ad82189c 100644
--- a/db/jsobj.h
+++ b/db/jsobj.h
@@ -206,6 +206,7 @@ class JSObj {
details = new Details();
details->_objdata = data;
details->_objsize = *((int*) data);
+ assert( details->_objsize < 1024 * 1024 * 16 );
details->refCount = ifree ? 1 : -1;
}
public:
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index b6809ad28eb..5b68175d4d7 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -977,7 +977,7 @@ DiskLoc DataFileMgr::insert(const char *ns, const void *buf, int len, bool god)
JSObj key = io.getObjectField("key");
if( name == 0 || *name == 0 || tabletoidxns == 0 || key.isEmpty() || key.objsize() > 2048 ) {
cout << "user warning: bad add index attempt name:" << (name?name:"") << " ns:" <<
- (tabletoidxns?tabletoidxns:"") << endl;
+ (tabletoidxns?tabletoidxns:"") << " ourns:" << ns << endl;
return DiskLoc();
}
tableToIndex = nsdetails(tabletoidxns);
diff --git a/db/query.cpp b/db/query.cpp
index f78c70ad735..8281f8d84fc 100644
--- a/db/query.cpp
+++ b/db/query.cpp
@@ -586,6 +586,7 @@ inline bool _runCommands(const char *ns, JSObj& jsobj, stringstream& ss, BufBuil
else if( e.type() == Number ) {
if( strcmp(e.fieldName(), "dropDatabase") == 0 ) {
if( 1 ) {
+ cout << "dropDatabase " << ns << endl;
valid = true;
int p = (int) e.number();
if( p != 1 ) {