diff -ur mongodb-src-r3.4.4/src/mongo/db/dbwebserver.cpp /home/steven/src/mongo/src/mongo/db/dbwebserver.cpp --- mongodb-src-r3.4.4/src/mongo/db/dbwebserver.cpp 2017-04-20 22:43:42.000000000 +0100 +++ /home/steven/src/mongo/src/mongo/db/dbwebserver.cpp 2017-07-17 14:22:03.817655992 +0100 @@ -67,6 +67,7 @@ using std::map; using std::stringstream; using std::vector; +using std::string; using namespace html; Binary files mongodb-src-r3.4.4/src/mongo/db/fts/unicode/gen_helper.pyc and /home/steven/src/mongo/src/mongo/db/fts/unicode/gen_helper.pyc differ diff -ur mongodb-src-r3.4.4/src/mongo/db/fts/unicode/string.cpp /home/steven/src/mongo/src/mongo/db/fts/unicode/string.cpp --- mongodb-src-r3.4.4/src/mongo/db/fts/unicode/string.cpp 2017-07-16 00:29:55.089130770 +0100 +++ /home/steven/src/mongo/src/mongo/db/fts/unicode/string.cpp 2017-07-16 09:35:31.837989128 +0100 @@ -274,7 +274,7 @@ // Case sensitive and diacritic sensitive. return boost::algorithm::boyer_moore_search( - haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end()); + haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end(); } } // namespace unicode diff -ur mongodb-src-r3.4.4/src/mongo/db/matcher/expression_leaf.cpp /home/steven/src/mongo/src/mongo/db/matcher/expression_leaf.cpp --- mongodb-src-r3.4.4/src/mongo/db/matcher/expression_leaf.cpp 2017-04-20 22:43:42.000000000 +0100 +++ /home/steven/src/mongo/src/mongo/db/matcher/expression_leaf.cpp 2017-07-17 14:22:03.817655992 +0100 @@ -202,7 +202,7 @@ } void ComparisonMatchExpression::serialize(BSONObjBuilder* out) const { - string opString = ""; + std::string opString = ""; switch (matchType()) { case LT: opString = "$lt"; @@ -884,7 +884,7 @@ } void BitTestMatchExpression::serialize(BSONObjBuilder* out) const { - string opString = ""; + std::string opString = ""; switch (matchType()) { case BITS_ALL_SET: diff -ur mongodb-src-r3.4.4/src/mongo/db/repl/master_slave.cpp /home/steven/src/mongo/src/mongo/db/repl/master_slave.cpp --- mongodb-src-r3.4.4/src/mongo/db/repl/master_slave.cpp 2017-04-20 22:43:42.000000000 +0100 +++ /home/steven/src/mongo/src/mongo/db/repl/master_slave.cpp 2017-07-17 14:22:03.817655992 +0100 @@ -168,7 +168,7 @@ BSONObjBuilder dbsNextPassBuilder; int n = 0; - for (set::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) { + for (set::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) { n++; dbsNextPassBuilder.appendBool(*i, 1); } @@ -177,7 +177,7 @@ BSONObjBuilder incompleteCloneDbsBuilder; n = 0; - for (set::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) { + for (set::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) { n++; incompleteCloneDbsBuilder.appendBool(*i, 1); } @@ -188,7 +188,7 @@ } void ReplSource::ensureMe(OperationContext* txn) { - string myname = getHostName(); + std::string myname = getHostName(); // local.me is an identifier for a server for getLastError w:2+ bool exists = Helpers::getSingleton(txn, "local.me", _me); @@ -378,10 +378,10 @@ } virtual bool run(OperationContext* txn, - const string& ns, + const std::string& ns, BSONObj& cmdObj, int options, - string& errmsg, + std::string& errmsg, BSONObjBuilder& result) { HandshakeArgs handshake; Status status = handshake.initialize(cmdObj); @@ -398,7 +398,7 @@ } handshakeCmd; bool replHandshake(DBClientConnection* conn, const OID& myRID) { - string myname = getHostName(); + std::string myname = getHostName(); BSONObjBuilder cmd; cmd.append("handshake", myRID); @@ -450,7 +450,7 @@ BSONElement e = i.next(); if (e.eoo()) break; - string name = e.embeddedObject().getField("name").valuestr(); + std::string name = e.embeddedObject().getField("name").valuestr(); if (!e.embeddedObject().getBoolField("empty")) { if (name != "local") { if (only.empty() || only == name) { @@ -481,7 +481,7 @@ return Status::OK(); } -void ReplSource::resyncDrop(OperationContext* txn, const string& dbName) { +void ReplSource::resyncDrop(OperationContext* txn, const std::string& dbName) { log() << "resync: dropping database " << dbName; invariant(txn->lockState()->isW()); @@ -531,13 +531,13 @@ static DatabaseIgnorer ___databaseIgnorer; -void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) { +void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) { if (futureOplogTime > _ignores[db]) { _ignores[db] = futureOplogTime; } } -bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) { +bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) { if (_ignores[db].isNull()) { return false; } @@ -627,7 +627,7 @@ // The database is present on the master and no conflicting databases // are present on the master. Drop any local conflicts. - for (set::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) { + for (set::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) { ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime); incompleteCloneDbs.erase(*i); addDbNextPass.erase(*i); @@ -826,10 +826,10 @@ } void ReplSource::syncToTailOfRemoteLog() { - string _ns = ns(); + std::string _ns = ns(); BSONObjBuilder b; if (!only.empty()) { - b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only)); + b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only)); } BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1))); if (!last.isEmpty()) { @@ -877,7 +877,7 @@ */ int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) { int okResultCode = restartSyncAfterSleep; - string ns = string("local.oplog.$") + sourceName(); + std::string ns = std::string("local.oplog.$") + sourceName(); LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n'; bool tailing = true; @@ -897,7 +897,7 @@ BSONElement e = i.next(); if (e.eoo()) break; - string name = e.embeddedObject().getField("name").valuestr(); + std::string name = e.embeddedObject().getField("name").valuestr(); if (!e.embeddedObject().getBoolField("empty")) { if (name != "local") { if (only.empty() || only == name) { @@ -921,7 +921,7 @@ if (!only.empty()) { // note we may here skip a LOT of data table scanning, a lot of work for the master. // maybe append "\\." here? - query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only)); + query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only)); } BSONObj queryObj = query.done(); // e.g. queryObj = { ts: { $gte: syncedTo } } @@ -940,7 +940,7 @@ // show any deferred database creates from a previous pass { - set::iterator i = addDbNextPass.begin(); + set::iterator i = addDbNextPass.begin(); if (i != addDbNextPass.end()) { BSONObjBuilder b; b.append("ns", *i + '.'); @@ -984,7 +984,7 @@ BSONObj op = oplogReader.nextSafe(); BSONElement ts = op.getField("ts"); if (ts.type() != Date && ts.type() != bsonTimestamp) { - string err = op.getStringField("$err"); + std::string err = op.getStringField("$err"); if (!err.empty()) { // 13051 is "tailable cursor requested on non capped collection" if (op.getIntField("code") == 13051) { @@ -1152,7 +1152,7 @@ // FIXME Handle cases where this db isn't on default port, or default port is spec'd in // hostName. - if ((string("localhost") == hostName || string("127.0.0.1") == hostName) && + if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) && serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) { log() << "can't sync from self (localhost). sources configuration may be wrong." << endl; sleepsecs(5); @@ -1297,7 +1297,7 @@ if (s) { stringstream ss; ss << "sleep " << s << " sec before next pass"; - string msg = ss.str(); + std::string msg = ss.str(); if (!serverGlobalParams.quiet) log() << msg << endl; ReplInfo r(msg.c_str()); diff -ur mongodb-src-r3.4.4/src/mongo/shell/bench.cpp /home/steven/src/mongo/src/mongo/shell/bench.cpp --- mongodb-src-r3.4.4/src/mongo/shell/bench.cpp 2017-07-16 09:27:44.155066843 +0100 +++ /home/steven/src/mongo/src/mongo/shell/bench.cpp 2017-07-17 14:22:03.821656019 +0100 @@ -918,7 +918,7 @@ if (!result["err"].eoo() && result["err"].type() == String && (_config->throwGLE || op.throwGLE)) - throw DBException((std::string) "From benchRun GLE" + + throw DBException((std::string) "From benchRun GLE" + causedBy(result["err"].String()), result["code"].eoo() ? 0 : result["code"].Int()); } @@ -984,7 +984,7 @@ if (!result["err"].eoo() && result["err"].type() == String && (_config->throwGLE || op.throwGLE)) - throw DBException((std::string) "From benchRun GLE" + + throw DBException((std::string) "From benchRun GLE" + causedBy(result["err"].String()), result["code"].eoo() ? 0 : result["code"].Int()); } @@ -1031,7 +1031,7 @@ if (!result["err"].eoo() && result["err"].type() == String && (_config->throwGLE || op.throwGLE)) - throw DBException((std::string) "From benchRun GLE " + + throw DBException((std::string) "From benchRun GLE " + causedBy(result["err"].String()), result["code"].eoo() ? 0 : result["code"].Int()); } @@ -1133,7 +1133,7 @@ try { std::unique_ptr conn(_config->createConnection()); if (!_config->username.empty()) { - std::string errmsg; + std::string errmsg; if (!conn->auth("admin", _config->username, _config->password, errmsg)) { uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg); } @@ -1165,7 +1165,7 @@ std::unique_ptr conn(_config->createConnection()); // Must authenticate to admin db in order to run serverStatus command if (_config->username != "") { - std::string errmsg; + std::string errmsg; if (!conn->auth("admin", _config->username, _config->password, errmsg)) { uasserted( 16704, @@ -1201,7 +1201,7 @@ { std::unique_ptr conn(_config->createConnection()); if (_config->username != "") { - std::string errmsg; + std::string errmsg; // this can only fail if admin access was revoked since start of run if (!conn->auth("admin", _config->username, _config->password, errmsg)) { uasserted( Only in mongodb-src-r3.4.4/src/mongo/shell: bench.cpp~ diff -ur mongodb-src-r3.4.4/src/mongo/util/net/miniwebserver.cpp /home/steven/src/mongo/src/mongo/util/net/miniwebserver.cpp --- mongodb-src-r3.4.4/src/mongo/util/net/miniwebserver.cpp 2017-04-20 22:43:42.000000000 +0100 +++ /home/steven/src/mongo/src/mongo/util/net/miniwebserver.cpp 2017-07-17 14:22:03.821656019 +0100 @@ -47,6 +47,7 @@ using std::shared_ptr; using std::stringstream; using std::vector; +using std::string; MiniWebServer::MiniWebServer(const string& name, const string& ip, int port, ServiceContext* ctx) : Listener(name, ip, port, ctx, false, false) {}