0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

Merge branch 'master' of github.com:mongodb/mongo

This commit is contained in:
Aaron 2010-06-03 12:24:46 -07:00
commit 43554f2403
11 changed files with 57 additions and 24 deletions

View File

@ -590,9 +590,10 @@ elif "win32" == os.sys.platform:
boostLibs = []
env.Append( CPPPATH=[ "js/src/" ] )
env.Append(CPPPATH=[ "js/src/" ])
env.Append(CPPPATH=["../js/src/"])
env.Append(LIBPATH=["../js/src"])
env.Append(LIBPATH=["../js/"])
env.Append( CPPDEFINES=[ "OLDJS" ] )
winSDKHome = findVersion( [ "C:/Program Files/Microsoft SDKs/Windows/", "C:/Program Files (x86)/Microsoft SDKs/Windows/" ] ,
@ -621,6 +622,7 @@ elif "win32" == os.sys.platform:
env.Append( CPPFLAGS= " /O2 /MT /Gy /Zi /TP /errorReport:none " )
# TODO: this has caused some linking problems :
# /GL whole program optimization
# /LTCG link time code generation
env.Append( CPPFLAGS= " /GL " )
env.Append( LINKFLAGS=" /LTCG " )
else:
@ -631,7 +633,7 @@ elif "win32" == os.sys.platform:
# RTC1 /GZ (Enable Stack Frame Run-Time Error Checking)
env.Append( CPPFLAGS=" /Od /RTC1 /MDd /Zi /TP /errorReport:none " )
env.Append( CPPFLAGS=' /Fd"mongod.pdb" ' )
env.Append( LINKFLAGS=" /incremental:yes /debug " )
env.Append( LINKFLAGS=" /debug " )
if force64 and os.path.exists( boostDir + "/lib/vs2010_64" ):
env.Append( LIBPATH=[ boostDir + "/lib/vs2010_64" ] )
@ -642,7 +644,7 @@ elif "win32" == os.sys.platform:
if force64:
env.Append( LIBPATH=[ winSDKHome + "/Lib/x64" ] )
env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " )
#env.Append( LINKFLAGS=" /NODEFAULTLIB:MSVCPRT /NODEFAULTLIB:MSVCRT " )
else:
env.Append( LIBPATH=[ winSDKHome + "/Lib" ] )
@ -669,7 +671,10 @@ elif "win32" == os.sys.platform:
winLibString = "ws2_32.lib kernel32.lib advapi32.lib Psapi.lib"
if force64:
winLibString += " LIBCMT LIBCPMT "
winLibString += ""
#winLibString += " LIBCMT LIBCPMT "
else:
winLibString += " user32.lib gdi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib "
winLibString += " odbc32.lib odbccp32.lib uuid.lib "
@ -930,7 +935,16 @@ def doConfigure( myenv , needPcre=True , shell=False ):
if usesm:
myCheckLib( [ "mozjs" , "js", "js_static" ] , True )
# see http://www.mongodb.org/pages/viewpageattachments.action?pageId=12157032
J = [ "mozjs" , "js", "js_static" ]
if windows and msarch == "amd64":
if release:
J = [ "js64r", "js", "mozjs" , "js_static" ]
else:
J = "js64d"
print( "will use js64d.lib for spidermonkey. (available at mongodb.org prebuilt.)" );
myCheckLib( J , True )
mozHeader = "js"
if bigLibString(myenv).find( "mozjs" ) >= 0:
mozHeader = "mozjs"

View File

@ -14,7 +14,7 @@ def shouldKill( c ):
if c.find( cwd ) >= 0:
return True
if c.find( "buildbot" ) >= 0 and c.find( "/mongo/" ) >= 0:
if ( c.find( "buildbot" ) >= 0 or c.find( "slave" ) ) and c.find( "/mongo/" ) >= 0:
return True
return False

View File

@ -119,7 +119,11 @@ namespace mongo {
arrElt = e;
}
// enforce single array path here
uassert( 10088 , "cannot index parallel arrays", e.type() != Array || e.rawdata() == arrElt.rawdata() );
if ( e.type() == Array && e.rawdata() != arrElt.rawdata() ){
stringstream ss;
ss << "cannot index parallel arrays [" << e.fieldName() << "] [" << arrElt.fieldName() << "]";
uasserted( 10088 , ss.str() );
}
}
bool allFound = true; // have we found elements for all field names in the key spec?

View File

@ -218,7 +218,7 @@ namespace mongo {
BSONObj o = fromjson("{\"initialsynccomplete\":1}");
Helpers::putSingleton("local.pair.sync", o);
initialsynccomplete = 1;
log() << "pair: initial sync complete" << endl;
tlog() << "pair: initial sync complete" << endl;
}
void setInitialSyncCompletedLocking() {

View File

@ -6,7 +6,7 @@ dbpath = "/data/db/" + baseDir + "/";
var m = startMongod( "--directoryperdb", "--port", port, "--dbpath", dbpath, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
db = m.getDB( baseName );
db[ baseName ].save( {} );
assert.eq( 1, db[ baseName ].count() , "A" );
assert.eq( 1, db[ baseName ].count() , "A : " + tojson( db[baseName].find().toArray() ) );
checkDir = function( dir ) {
db.runCommand( {fsync:1} );

12
pch.h
View File

@ -20,6 +20,18 @@
#pragma once
#if defined(MONGO_EXPOSE_MACROS)
#define JS_C_STRINGS_ARE_UTF8
#undef _UNICODE
#define _UNICODE
#undef UNICODE
#define UNICODE
#undef SUPPORT_UCP
#define SUPPORT_UCP
#undef SUPPORT_UTF8
#define SUPPORT_UTF8
#endif
#if defined(_WIN32)
# define NOMINMAX
# include <winsock2.h> //this must be included before the first windows.h include

View File

@ -37,7 +37,7 @@
#include "jstypes.h"
#undef JS_PUBLIC_API
#undef JS_PUBLIC_DATA
#define JS_PUBLIC_API(t) t
#define JS_PUBLIC_API(t) t __cdecl
#define JS_PUBLIC_DATA(t) t
#endif

View File

@ -224,10 +224,12 @@ public:
ProgressMeter pm( fileSize );
const int BUF_SIZE = 1024 * 1024 * 4;
boost::scoped_array<char> line(new char[BUF_SIZE+2]);
while ( *in ){
while ( in->rdstate() == 0 ){
char * buf = line.get();
in->getline( buf , BUF_SIZE );
uassert( 10263 , "unknown error reading file" , ( in->rdstate() & ios_base::badbit ) == 0 );
uassert( 10263 , "unknown error reading file" ,
(!(in->rdstate() & ios_base::badbit)) &&
(!(in->rdstate() & ios_base::failbit) || (in->rdstate() & ios_base::eofbit)) );
log(1) << "got line:" << buf << endl;
while( isspace( buf[0] ) ) buf++;
@ -238,10 +240,6 @@ public:
buf[len+1] = 0;
if ( in->rdstate() == ios_base::eofbit )
break;
assert( in->rdstate() == 0 );
try {
BSONObj o = parseLine( buf );
if ( _headerLine ){

View File

@ -136,7 +136,6 @@ namespace mongo {
ss << setw(width) << val << " ";
}
string doRow( const BSONObj& a , const BSONObj& b ){
stringstream ss;
@ -150,7 +149,14 @@ namespace mongo {
}
}
if ( b.getFieldDotted("mem.supported").trueValue() ){
if ( b["backgroundFlushing"].type() == Object ){
BSONObj ax = a["backgroundFlushing"].embeddedObject();
BSONObj bx = b["backgroundFlushing"].embeddedObject();
BSONObjIterator i( bx );
cell( ss , "flushes/s" , 6 , (int)diff( "flushes" , ax , bx ) );
}
if ( b.getFieldDotted("mem.supported").trueValue() ){
BSONObj bx = b["mem"].embeddedObject();
BSONObjIterator i( bx );
cell( ss , "mapped" , 6 , bx["mapped"].numberInt() );

View File

@ -111,11 +111,14 @@ namespace mongo {
SERVICE_STATUS serviceStatus;
// stop service if running
// stop service if its running
if ( ::ControlService( schService, SERVICE_CONTROL_STOP, &serviceStatus ) ) {
while ( ::QueryServiceStatus( schService, &serviceStatus ) ) {
if ( serviceStatus.dwCurrentState == SERVICE_STOP_PENDING )
Sleep( 1000 );
{
Sleep( 1000 );
}
else { break; }
}
}

View File

@ -62,10 +62,6 @@ namespace mongo {
//
void show_32_warning(){
#if BOOST_VERSION < 103500
cout << "\nwarning: built with boost version <= 1.34, limited concurrency" << endl;
#endif
{
const char * foo = strchr( versionString , '.' ) + 1;
int bar = atoi( foo );