summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-03-20 12:19:21 -0400
committerDwight <dmerriman@gmail.com>2009-03-20 12:19:21 -0400
commit554cc099045b9d68b641a2f9b5ca58da1b900494 (patch)
tree490603ec65db96a048ac90d9cf309e80dec0cfc4 /db
parent3c2196420e0918937ca38df21e92144ac0bb5456 (diff)
downloadmongo-554cc099045b9d68b641a2f9b5ca58da1b900494.tar.gz
minor: better error message
Diffstat (limited to 'db')
-rw-r--r--db/database.h6
-rw-r--r--db/db.sln1
-rw-r--r--db/reccache.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/db/database.h b/db/database.h
index 76db293cad2..f71200fbd3b 100644
--- a/db/database.h
+++ b/db/database.h
@@ -60,7 +60,11 @@ namespace mongo {
namespaceIndex.init();
if ( n < 0 || n >= DiskLoc::MaxFiles ) {
out() << "getFile(): n=" << n << endl;
- assert( n >= 0 && n < DiskLoc::MaxFiles );
+#if !defined(_RECSTORE)
+ if( n >= RecCache::Base && n <= RecCache::Base+1000 )
+ massert("getFile(): bad file number - using recstore db w/nonrecstore db build?", false);
+#endif
+ massert("getFile(): bad file number value (corrupt db?)", false);
}
DEV {
if ( n > 100 )
diff --git a/db/db.sln b/db/db.sln
index 3e222925472..0b6a4028968 100644
--- a/db/db.sln
+++ b/db/db.sln
@@ -5,7 +5,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "db", "db.vcproj", "{215B2D6
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{4082881B-EB00-486F-906C-843B8EC06E18}"
ProjectSection(SolutionItems) = preProject
- ..\client\examples\authTest.cpp = ..\client\examples\authTest.cpp
..\client\examples\clientTest.cpp = ..\client\examples\clientTest.cpp
..\client\examples\first.cpp = ..\client\examples\first.cpp
..\client\examples\second.cpp = ..\client\examples\second.cpp
diff --git a/db/reccache.h b/db/reccache.h
index ed2214fa5ad..35e737419b4 100644
--- a/db/reccache.h
+++ b/db/reccache.h
@@ -41,8 +41,9 @@ class RecCache {
set<DiskLoc> dirtyl;
vector<BasicRecStore*> stores;
map<string, BasicRecStore*> storesByNs;
+public:
enum { Base = 10000 };
-
+private:
BasicRecStore* _initStore(string fname);
BasicRecStore* initStore(int n);
string findStoreFilename(const char *_ns, bool& found);