Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 625148 | Differences between
and this patch

Collapse All | Expand All

(-)mongodb-src-r3.2.16_orig/src/mongo/db/dbwebserver.cpp (+1 lines)
Lines 69-74 Link Here
69
using std::map;
69
using std::map;
70
using std::stringstream;
70
using std::stringstream;
71
using std::vector;
71
using std::vector;
72
using std::string;
72
73
73
using namespace html;
74
using namespace html;
74
75
(-)mongodb-src-r3.2.16_orig/src/mongo/db/matcher/expression_leaf.cpp (-2 / +2 lines)
Lines 200-206 Link Here
200
}
200
}
201
201
202
void ComparisonMatchExpression::toBSON(BSONObjBuilder* out) const {
202
void ComparisonMatchExpression::toBSON(BSONObjBuilder* out) const {
203
    string opString = "";
203
    std::string opString = "";
204
    switch (matchType()) {
204
    switch (matchType()) {
205
        case LT:
205
        case LT:
206
            opString = "$lt";
206
            opString = "$lt";
Lines 880-886 Link Here
880
}
880
}
881
881
882
void BitTestMatchExpression::toBSON(BSONObjBuilder* out) const {
882
void BitTestMatchExpression::toBSON(BSONObjBuilder* out) const {
883
    string opString = "";
883
    std::string opString = "";
884
884
885
    switch (matchType()) {
885
    switch (matchType()) {
886
        case BITS_ALL_SET:
886
        case BITS_ALL_SET:
(-)mongodb-src-r3.2.16_orig/src/mongo/db/repl/master_slave.cpp (-20 / +20 lines)
Lines 161-167 Link Here
161
161
162
    BSONObjBuilder dbsNextPassBuilder;
162
    BSONObjBuilder dbsNextPassBuilder;
163
    int n = 0;
163
    int n = 0;
164
    for (set<string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
164
    for (set<std::string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
165
        n++;
165
        n++;
166
        dbsNextPassBuilder.appendBool(*i, 1);
166
        dbsNextPassBuilder.appendBool(*i, 1);
167
    }
167
    }
Lines 170-176 Link Here
170
170
171
    BSONObjBuilder incompleteCloneDbsBuilder;
171
    BSONObjBuilder incompleteCloneDbsBuilder;
172
    n = 0;
172
    n = 0;
173
    for (set<string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
173
    for (set<std::string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
174
        n++;
174
        n++;
175
        incompleteCloneDbsBuilder.appendBool(*i, 1);
175
        incompleteCloneDbsBuilder.appendBool(*i, 1);
176
    }
176
    }
Lines 181-187 Link Here
181
}
181
}
182
182
183
void ReplSource::ensureMe(OperationContext* txn) {
183
void ReplSource::ensureMe(OperationContext* txn) {
184
    string myname = getHostName();
184
    std::string myname = getHostName();
185
185
186
    // local.me is an identifier for a server for getLastError w:2+
186
    // local.me is an identifier for a server for getLastError w:2+
187
    bool exists = Helpers::getSingleton(txn, "local.me", _me);
187
    bool exists = Helpers::getSingleton(txn, "local.me", _me);
Lines 373-382 Link Here
373
    }
373
    }
374
374
375
    virtual bool run(OperationContext* txn,
375
    virtual bool run(OperationContext* txn,
376
                     const string& ns,
376
                     const std::string& ns,
377
                     BSONObj& cmdObj,
377
                     BSONObj& cmdObj,
378
                     int options,
378
                     int options,
379
                     string& errmsg,
379
                     std::string& errmsg,
380
                     BSONObjBuilder& result) {
380
                     BSONObjBuilder& result) {
381
        HandshakeArgs handshake;
381
        HandshakeArgs handshake;
382
        Status status = handshake.initialize(cmdObj);
382
        Status status = handshake.initialize(cmdObj);
Lines 393-399 Link Here
393
} handshakeCmd;
393
} handshakeCmd;
394
394
395
bool replHandshake(DBClientConnection* conn, const OID& myRID) {
395
bool replHandshake(DBClientConnection* conn, const OID& myRID) {
396
    string myname = getHostName();
396
    std::string myname = getHostName();
397
397
398
    BSONObjBuilder cmd;
398
    BSONObjBuilder cmd;
399
    cmd.append("handshake", myRID);
399
    cmd.append("handshake", myRID);
Lines 445-451 Link Here
445
        BSONElement e = i.next();
445
        BSONElement e = i.next();
446
        if (e.eoo())
446
        if (e.eoo())
447
            break;
447
            break;
448
        string name = e.embeddedObject().getField("name").valuestr();
448
	std::string name = e.embeddedObject().getField("name").valuestr();
449
        if (!e.embeddedObject().getBoolField("empty")) {
449
        if (!e.embeddedObject().getBoolField("empty")) {
450
            if (name != "local") {
450
            if (name != "local") {
451
                if (only.empty() || only == name) {
451
                if (only.empty() || only == name) {
Lines 459-465 Link Here
459
    save(txn);
459
    save(txn);
460
}
460
}
461
461
462
void ReplSource::resyncDrop(OperationContext* txn, const string& db) {
462
void ReplSource::resyncDrop(OperationContext* txn, const std::string& db) {
463
    log() << "resync: dropping database " << db;
463
    log() << "resync: dropping database " << db;
464
    OldClientContext ctx(txn, db);
464
    OldClientContext ctx(txn, db);
465
    dropDatabase(txn, ctx.db());
465
    dropDatabase(txn, ctx.db());
Lines 502-514 Link Here
502
502
503
static DatabaseIgnorer ___databaseIgnorer;
503
static DatabaseIgnorer ___databaseIgnorer;
504
504
505
void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) {
505
void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) {
506
    if (futureOplogTime > _ignores[db]) {
506
    if (futureOplogTime > _ignores[db]) {
507
        _ignores[db] = futureOplogTime;
507
        _ignores[db] = futureOplogTime;
508
    }
508
    }
509
}
509
}
510
510
511
bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) {
511
bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) {
512
    if (_ignores[db].isNull()) {
512
    if (_ignores[db].isNull()) {
513
        return false;
513
        return false;
514
    }
514
    }
Lines 598-604 Link Here
598
598
599
    // The database is present on the master and no conflicting databases
599
    // The database is present on the master and no conflicting databases
600
    // are present on the master.  Drop any local conflicts.
600
    // are present on the master.  Drop any local conflicts.
601
    for (set<string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
601
    for (set<std::string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
602
        ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
602
        ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
603
        incompleteCloneDbs.erase(*i);
603
        incompleteCloneDbs.erase(*i);
604
        addDbNextPass.erase(*i);
604
        addDbNextPass.erase(*i);
Lines 793-802 Link Here
793
}
793
}
794
794
795
void ReplSource::syncToTailOfRemoteLog() {
795
void ReplSource::syncToTailOfRemoteLog() {
796
    string _ns = ns();
796
    std::string _ns = ns();
797
    BSONObjBuilder b;
797
    BSONObjBuilder b;
798
    if (!only.empty()) {
798
    if (!only.empty()) {
799
        b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
799
        b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
800
    }
800
    }
801
    BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
801
    BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
802
    if (!last.isEmpty()) {
802
    if (!last.isEmpty()) {
Lines 844-850 Link Here
844
*/
844
*/
845
int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
845
int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
846
    int okResultCode = 1;
846
    int okResultCode = 1;
847
    string ns = string("local.oplog.$") + sourceName();
847
    std::string ns = std::string("local.oplog.$") + sourceName();
848
    LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
848
    LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
849
849
850
    bool tailing = true;
850
    bool tailing = true;
Lines 864-870 Link Here
864
                BSONElement e = i.next();
864
                BSONElement e = i.next();
865
                if (e.eoo())
865
                if (e.eoo())
866
                    break;
866
                    break;
867
                string name = e.embeddedObject().getField("name").valuestr();
867
		std::string name = e.embeddedObject().getField("name").valuestr();
868
                if (!e.embeddedObject().getBoolField("empty")) {
868
                if (!e.embeddedObject().getBoolField("empty")) {
869
                    if (name != "local") {
869
                    if (name != "local") {
870
                        if (only.empty() || only == name) {
870
                        if (only.empty() || only == name) {
Lines 888-894 Link Here
888
        if (!only.empty()) {
888
        if (!only.empty()) {
889
            // note we may here skip a LOT of data table scanning, a lot of work for the master.
889
            // note we may here skip a LOT of data table scanning, a lot of work for the master.
890
            // maybe append "\\." here?
890
            // maybe append "\\." here?
891
            query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
891
            query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
892
        }
892
        }
893
        BSONObj queryObj = query.done();
893
        BSONObj queryObj = query.done();
894
        // e.g. queryObj = { ts: { $gte: syncedTo } }
894
        // e.g. queryObj = { ts: { $gte: syncedTo } }
Lines 907-913 Link Here
907
907
908
    // show any deferred database creates from a previous pass
908
    // show any deferred database creates from a previous pass
909
    {
909
    {
910
        set<string>::iterator i = addDbNextPass.begin();
910
        set<std::string>::iterator i = addDbNextPass.begin();
911
        if (i != addDbNextPass.end()) {
911
        if (i != addDbNextPass.end()) {
912
            BSONObjBuilder b;
912
            BSONObjBuilder b;
913
            b.append("ns", *i + '.');
913
            b.append("ns", *i + '.');
Lines 938-944 Link Here
938
        BSONObj op = oplogReader.next();
938
        BSONObj op = oplogReader.next();
939
        BSONElement ts = op.getField("ts");
939
        BSONElement ts = op.getField("ts");
940
        if (ts.type() != Date && ts.type() != bsonTimestamp) {
940
        if (ts.type() != Date && ts.type() != bsonTimestamp) {
941
            string err = op.getStringField("$err");
941
	    std::string err = op.getStringField("$err");
942
            if (!err.empty()) {
942
            if (!err.empty()) {
943
                // 13051 is "tailable cursor requested on non capped collection"
943
                // 13051 is "tailable cursor requested on non capped collection"
944
                if (op.getIntField("code") == 13051) {
944
                if (op.getIntField("code") == 13051) {
Lines 1106-1112 Link Here
1106
1106
1107
    // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
1107
    // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
1108
    // hostName.
1108
    // hostName.
1109
    if ((string("localhost") == hostName || string("127.0.0.1") == hostName) &&
1109
    if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) &&
1110
        serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
1110
        serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
1111
        log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
1111
        log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
1112
        sleepsecs(5);
1112
        sleepsecs(5);
Lines 1251-1257 Link Here
1251
        if (s) {
1251
        if (s) {
1252
            stringstream ss;
1252
            stringstream ss;
1253
            ss << "sleep " << s << " sec before next pass";
1253
            ss << "sleep " << s << " sec before next pass";
1254
            string msg = ss.str();
1254
	    std::string msg = ss.str();
1255
            if (!serverGlobalParams.quiet)
1255
            if (!serverGlobalParams.quiet)
1256
                log() << msg << endl;
1256
                log() << msg << endl;
1257
            ReplInfo r(msg.c_str());
1257
            ReplInfo r(msg.c_str());
(-)mongodb-src-r3.2.16_orig/src/mongo/shell/bench.cpp (-7 / +7 lines)
Lines 674-680 Link Here
674
    invariant(bsonTemplateEvaluator.setId(_id) == BsonTemplateEvaluator::StatusSuccess);
674
    invariant(bsonTemplateEvaluator.setId(_id) == BsonTemplateEvaluator::StatusSuccess);
675
675
676
    if (_config->username != "") {
676
    if (_config->username != "") {
677
        string errmsg;
677
	std::string errmsg;
678
        if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
678
        if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
679
            uasserted(15931, "Authenticating to connection for _benchThread failed: " + errmsg);
679
            uasserted(15931, "Authenticating to connection for _benchThread failed: " + errmsg);
680
        }
680
        }
Lines 920-926 Link Here
920
920
921
                            if (!result["err"].eoo() && result["err"].type() == String &&
921
                            if (!result["err"].eoo() && result["err"].type() == String &&
922
                                (_config->throwGLE || op.throwGLE))
922
                                (_config->throwGLE || op.throwGLE))
923
                                throw DBException((string) "From benchRun GLE" +
923
                                throw DBException((std::string) "From benchRun GLE" +
924
                                                      causedBy(result["err"].String()),
924
                                                      causedBy(result["err"].String()),
925
                                                  result["code"].eoo() ? 0 : result["code"].Int());
925
                                                  result["code"].eoo() ? 0 : result["code"].Int());
926
                        }
926
                        }
Lines 987-993 Link Here
987
987
988
                            if (!result["err"].eoo() && result["err"].type() == String &&
988
                            if (!result["err"].eoo() && result["err"].type() == String &&
989
                                (_config->throwGLE || op.throwGLE))
989
                                (_config->throwGLE || op.throwGLE))
990
                                throw DBException((string) "From benchRun GLE" +
990
                                throw DBException((std::string) "From benchRun GLE" +
991
                                                      causedBy(result["err"].String()),
991
                                                      causedBy(result["err"].String()),
992
                                                  result["code"].eoo() ? 0 : result["code"].Int());
992
                                                  result["code"].eoo() ? 0 : result["code"].Int());
993
                        }
993
                        }
Lines 1035-1041 Link Here
1035
1035
1036
                            if (!result["err"].eoo() && result["err"].type() == String &&
1036
                            if (!result["err"].eoo() && result["err"].type() == String &&
1037
                                (_config->throwGLE || op.throwGLE))
1037
                                (_config->throwGLE || op.throwGLE))
1038
                                throw DBException((string) "From benchRun GLE " +
1038
                                throw DBException((std::string) "From benchRun GLE " +
1039
                                                      causedBy(result["err"].String()),
1039
                                                      causedBy(result["err"].String()),
1040
                                                  result["code"].eoo() ? 0 : result["code"].Int());
1040
                                                  result["code"].eoo() ? 0 : result["code"].Int());
1041
                        }
1041
                        }
Lines 1136-1142 Link Here
1136
    try {
1136
    try {
1137
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1137
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1138
        if (!_config->username.empty()) {
1138
        if (!_config->username.empty()) {
1139
            string errmsg;
1139
	    std::string errmsg;
1140
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1140
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1141
                uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
1141
                uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
1142
            }
1142
            }
Lines 1168-1174 Link Here
1168
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1168
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1169
        // Must authenticate to admin db in order to run serverStatus command
1169
        // Must authenticate to admin db in order to run serverStatus command
1170
        if (_config->username != "") {
1170
        if (_config->username != "") {
1171
            string errmsg;
1171
	    std::string errmsg;
1172
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1172
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1173
                uasserted(16704,
1173
                uasserted(16704,
1174
                          str::stream()
1174
                          str::stream()
Lines 1204-1210 Link Here
1204
    {
1204
    {
1205
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1205
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1206
        if (_config->username != "") {
1206
        if (_config->username != "") {
1207
            string errmsg;
1207
	    std::string errmsg;
1208
            // this can only fail if admin access was revoked since start of run
1208
            // this can only fail if admin access was revoked since start of run
1209
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1209
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1210
                uasserted(16705,
1210
                uasserted(16705,
(-)mongodb-src-r3.2.16_orig/src/mongo/util/net/miniwebserver.cpp (-1 / +2 lines)
Lines 45-52 Link Here
45
using std::endl;
45
using std::endl;
46
using std::stringstream;
46
using std::stringstream;
47
using std::vector;
47
using std::vector;
48
using std::string;
48
49
49
MiniWebServer::MiniWebServer(const string& name, const string& ip, int port)
50
MiniWebServer::MiniWebServer(const std::string& name, const std::string& ip, int port)
50
    : Listener(name, ip, port, false) {}
51
    : Listener(name, ip, port, false) {}
51
52
52
string MiniWebServer::parseURL(const char* buf) {
53
string MiniWebServer::parseURL(const char* buf) {

Return to bug 625148