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.4.4/src/mongo/db/dbwebserver.cpp (+1 lines)
Lines 67-72 Link Here
67
using std::map;
67
using std::map;
68
using std::stringstream;
68
using std::stringstream;
69
using std::vector;
69
using std::vector;
70
using std::string;
70
71
71
using namespace html;
72
using namespace html;
72
73
(-)mongodb-src-r3.4.4/src/mongo/db/fts/unicode/string.cpp (-1 / +1 lines)
Lines 274-280 Link Here
274
274
275
    // Case sensitive and diacritic sensitive.
275
    // Case sensitive and diacritic sensitive.
276
    return boost::algorithm::boyer_moore_search(
276
    return boost::algorithm::boyer_moore_search(
277
               haystack.begin(), haystack.end(), needle.begin(), needle.end()) != std::make_pair(haystack.end(), haystack.end());
277
               haystack.begin(), haystack.end(), needle.begin(), needle.end()) != haystack.end();
278
}
278
}
279
279
280
}  // namespace unicode
280
}  // namespace unicode
(-)mongodb-src-r3.4.4/src/mongo/db/matcher/expression_leaf.cpp (-2 / +2 lines)
Lines 202-208 Link Here
202
}
202
}
203
203
204
void ComparisonMatchExpression::serialize(BSONObjBuilder* out) const {
204
void ComparisonMatchExpression::serialize(BSONObjBuilder* out) const {
205
    string opString = "";
205
    std::string opString = "";
206
    switch (matchType()) {
206
    switch (matchType()) {
207
        case LT:
207
        case LT:
208
            opString = "$lt";
208
            opString = "$lt";
Lines 884-890 Link Here
884
}
884
}
885
885
886
void BitTestMatchExpression::serialize(BSONObjBuilder* out) const {
886
void BitTestMatchExpression::serialize(BSONObjBuilder* out) const {
887
    string opString = "";
887
    std::string opString = "";
888
888
889
    switch (matchType()) {
889
    switch (matchType()) {
890
        case BITS_ALL_SET:
890
        case BITS_ALL_SET:
(-)mongodb-src-r3.4.4/src/mongo/db/repl/master_slave.cpp (-20 / +20 lines)
Lines 168-174 Link Here
168
168
169
    BSONObjBuilder dbsNextPassBuilder;
169
    BSONObjBuilder dbsNextPassBuilder;
170
    int n = 0;
170
    int n = 0;
171
    for (set<string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
171
    for (set<std::string>::iterator i = addDbNextPass.begin(); i != addDbNextPass.end(); i++) {
172
        n++;
172
        n++;
173
        dbsNextPassBuilder.appendBool(*i, 1);
173
        dbsNextPassBuilder.appendBool(*i, 1);
174
    }
174
    }
Lines 177-183 Link Here
177
177
178
    BSONObjBuilder incompleteCloneDbsBuilder;
178
    BSONObjBuilder incompleteCloneDbsBuilder;
179
    n = 0;
179
    n = 0;
180
    for (set<string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
180
    for (set<std::string>::iterator i = incompleteCloneDbs.begin(); i != incompleteCloneDbs.end(); i++) {
181
        n++;
181
        n++;
182
        incompleteCloneDbsBuilder.appendBool(*i, 1);
182
        incompleteCloneDbsBuilder.appendBool(*i, 1);
183
    }
183
    }
Lines 188-194 Link Here
188
}
188
}
189
189
190
void ReplSource::ensureMe(OperationContext* txn) {
190
void ReplSource::ensureMe(OperationContext* txn) {
191
    string myname = getHostName();
191
    std::string myname = getHostName();
192
192
193
    // local.me is an identifier for a server for getLastError w:2+
193
    // local.me is an identifier for a server for getLastError w:2+
194
    bool exists = Helpers::getSingleton(txn, "local.me", _me);
194
    bool exists = Helpers::getSingleton(txn, "local.me", _me);
Lines 378-387 Link Here
378
    }
378
    }
379
379
380
    virtual bool run(OperationContext* txn,
380
    virtual bool run(OperationContext* txn,
381
                     const string& ns,
381
                     const std::string& ns,
382
                     BSONObj& cmdObj,
382
                     BSONObj& cmdObj,
383
                     int options,
383
                     int options,
384
                     string& errmsg,
384
                     std::string& errmsg,
385
                     BSONObjBuilder& result) {
385
                     BSONObjBuilder& result) {
386
        HandshakeArgs handshake;
386
        HandshakeArgs handshake;
387
        Status status = handshake.initialize(cmdObj);
387
        Status status = handshake.initialize(cmdObj);
Lines 398-404 Link Here
398
} handshakeCmd;
398
} handshakeCmd;
399
399
400
bool replHandshake(DBClientConnection* conn, const OID& myRID) {
400
bool replHandshake(DBClientConnection* conn, const OID& myRID) {
401
    string myname = getHostName();
401
    std::string myname = getHostName();
402
402
403
    BSONObjBuilder cmd;
403
    BSONObjBuilder cmd;
404
    cmd.append("handshake", myRID);
404
    cmd.append("handshake", myRID);
Lines 450-456 Link Here
450
        BSONElement e = i.next();
450
        BSONElement e = i.next();
451
        if (e.eoo())
451
        if (e.eoo())
452
            break;
452
            break;
453
        string name = e.embeddedObject().getField("name").valuestr();
453
        std::string name = e.embeddedObject().getField("name").valuestr();
454
        if (!e.embeddedObject().getBoolField("empty")) {
454
        if (!e.embeddedObject().getBoolField("empty")) {
455
            if (name != "local") {
455
            if (name != "local") {
456
                if (only.empty() || only == name) {
456
                if (only.empty() || only == name) {
Lines 481-487 Link Here
481
    return Status::OK();
481
    return Status::OK();
482
}
482
}
483
483
484
void ReplSource::resyncDrop(OperationContext* txn, const string& dbName) {
484
void ReplSource::resyncDrop(OperationContext* txn, const std::string& dbName) {
485
    log() << "resync: dropping database " << dbName;
485
    log() << "resync: dropping database " << dbName;
486
    invariant(txn->lockState()->isW());
486
    invariant(txn->lockState()->isW());
487
487
Lines 531-543 Link Here
531
531
532
static DatabaseIgnorer ___databaseIgnorer;
532
static DatabaseIgnorer ___databaseIgnorer;
533
533
534
void DatabaseIgnorer::doIgnoreUntilAfter(const string& db, const Timestamp& futureOplogTime) {
534
void DatabaseIgnorer::doIgnoreUntilAfter(const std::string& db, const Timestamp& futureOplogTime) {
535
    if (futureOplogTime > _ignores[db]) {
535
    if (futureOplogTime > _ignores[db]) {
536
        _ignores[db] = futureOplogTime;
536
        _ignores[db] = futureOplogTime;
537
    }
537
    }
538
}
538
}
539
539
540
bool DatabaseIgnorer::ignoreAt(const string& db, const Timestamp& currentOplogTime) {
540
bool DatabaseIgnorer::ignoreAt(const std::string& db, const Timestamp& currentOplogTime) {
541
    if (_ignores[db].isNull()) {
541
    if (_ignores[db].isNull()) {
542
        return false;
542
        return false;
543
    }
543
    }
Lines 627-633 Link Here
627
627
628
    // The database is present on the master and no conflicting databases
628
    // The database is present on the master and no conflicting databases
629
    // are present on the master.  Drop any local conflicts.
629
    // are present on the master.  Drop any local conflicts.
630
    for (set<string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
630
    for (set<std::string>::const_iterator i = duplicates.begin(); i != duplicates.end(); ++i) {
631
        ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
631
        ___databaseIgnorer.doIgnoreUntilAfter(*i, lastTime);
632
        incompleteCloneDbs.erase(*i);
632
        incompleteCloneDbs.erase(*i);
633
        addDbNextPass.erase(*i);
633
        addDbNextPass.erase(*i);
Lines 826-835 Link Here
826
}
826
}
827
827
828
void ReplSource::syncToTailOfRemoteLog() {
828
void ReplSource::syncToTailOfRemoteLog() {
829
    string _ns = ns();
829
    std::string _ns = ns();
830
    BSONObjBuilder b;
830
    BSONObjBuilder b;
831
    if (!only.empty()) {
831
    if (!only.empty()) {
832
        b.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
832
        b.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
833
    }
833
    }
834
    BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
834
    BSONObj last = oplogReader.findOne(_ns.c_str(), Query(b.done()).sort(BSON("$natural" << -1)));
835
    if (!last.isEmpty()) {
835
    if (!last.isEmpty()) {
Lines 877-883 Link Here
877
*/
877
*/
878
int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
878
int ReplSource::_sync_pullOpLog(OperationContext* txn, int& nApplied) {
879
    int okResultCode = restartSyncAfterSleep;
879
    int okResultCode = restartSyncAfterSleep;
880
    string ns = string("local.oplog.$") + sourceName();
880
    std::string ns = std::string("local.oplog.$") + sourceName();
881
    LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
881
    LOG(2) << "sync_pullOpLog " << ns << " syncedTo:" << syncedTo.toStringLong() << '\n';
882
882
883
    bool tailing = true;
883
    bool tailing = true;
Lines 897-903 Link Here
897
                BSONElement e = i.next();
897
                BSONElement e = i.next();
898
                if (e.eoo())
898
                if (e.eoo())
899
                    break;
899
                    break;
900
                string name = e.embeddedObject().getField("name").valuestr();
900
                std::string name = e.embeddedObject().getField("name").valuestr();
901
                if (!e.embeddedObject().getBoolField("empty")) {
901
                if (!e.embeddedObject().getBoolField("empty")) {
902
                    if (name != "local") {
902
                    if (name != "local") {
903
                        if (only.empty() || only == name) {
903
                        if (only.empty() || only == name) {
Lines 921-927 Link Here
921
        if (!only.empty()) {
921
        if (!only.empty()) {
922
            // note we may here skip a LOT of data table scanning, a lot of work for the master.
922
            // note we may here skip a LOT of data table scanning, a lot of work for the master.
923
            // maybe append "\\." here?
923
            // maybe append "\\." here?
924
            query.appendRegex("ns", string("^") + pcrecpp::RE::QuoteMeta(only));
924
            query.appendRegex("ns", std::string("^") + pcrecpp::RE::QuoteMeta(only));
925
        }
925
        }
926
        BSONObj queryObj = query.done();
926
        BSONObj queryObj = query.done();
927
        // e.g. queryObj = { ts: { $gte: syncedTo } }
927
        // e.g. queryObj = { ts: { $gte: syncedTo } }
Lines 940-946 Link Here
940
940
941
    // show any deferred database creates from a previous pass
941
    // show any deferred database creates from a previous pass
942
    {
942
    {
943
        set<string>::iterator i = addDbNextPass.begin();
943
        set<std::string>::iterator i = addDbNextPass.begin();
944
        if (i != addDbNextPass.end()) {
944
        if (i != addDbNextPass.end()) {
945
            BSONObjBuilder b;
945
            BSONObjBuilder b;
946
            b.append("ns", *i + '.');
946
            b.append("ns", *i + '.');
Lines 984-990 Link Here
984
        BSONObj op = oplogReader.nextSafe();
984
        BSONObj op = oplogReader.nextSafe();
985
        BSONElement ts = op.getField("ts");
985
        BSONElement ts = op.getField("ts");
986
        if (ts.type() != Date && ts.type() != bsonTimestamp) {
986
        if (ts.type() != Date && ts.type() != bsonTimestamp) {
987
            string err = op.getStringField("$err");
987
            std::string err = op.getStringField("$err");
988
            if (!err.empty()) {
988
            if (!err.empty()) {
989
                // 13051 is "tailable cursor requested on non capped collection"
989
                // 13051 is "tailable cursor requested on non capped collection"
990
                if (op.getIntField("code") == 13051) {
990
                if (op.getIntField("code") == 13051) {
Lines 1152-1158 Link Here
1152
1152
1153
    // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
1153
    // FIXME Handle cases where this db isn't on default port, or default port is spec'd in
1154
    // hostName.
1154
    // hostName.
1155
    if ((string("localhost") == hostName || string("127.0.0.1") == hostName) &&
1155
    if ((std::string("localhost") == hostName || std::string("127.0.0.1") == hostName) &&
1156
        serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
1156
        serverGlobalParams.port == ServerGlobalParams::DefaultDBPort) {
1157
        log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
1157
        log() << "can't sync from self (localhost). sources configuration may be wrong." << endl;
1158
        sleepsecs(5);
1158
        sleepsecs(5);
Lines 1297-1303 Link Here
1297
        if (s) {
1297
        if (s) {
1298
            stringstream ss;
1298
            stringstream ss;
1299
            ss << "sleep " << s << " sec before next pass";
1299
            ss << "sleep " << s << " sec before next pass";
1300
            string msg = ss.str();
1300
            std::string msg = ss.str();
1301
            if (!serverGlobalParams.quiet)
1301
            if (!serverGlobalParams.quiet)
1302
                log() << msg << endl;
1302
                log() << msg << endl;
1303
            ReplInfo r(msg.c_str());
1303
            ReplInfo r(msg.c_str());
(-)mongodb-src-r3.4.4/src/mongo/shell/bench.cpp (-6 / +6 lines)
Lines 918-924 Link Here
918
918
919
                            if (!result["err"].eoo() && result["err"].type() == String &&
919
                            if (!result["err"].eoo() && result["err"].type() == String &&
920
                                (_config->throwGLE || op.throwGLE))
920
                                (_config->throwGLE || op.throwGLE))
921
			      throw DBException((std::string) "From benchRun GLE" +
921
                                throw DBException((std::string) "From benchRun GLE" +
922
                                                      causedBy(result["err"].String()),
922
                                                      causedBy(result["err"].String()),
923
                                                  result["code"].eoo() ? 0 : result["code"].Int());
923
                                                  result["code"].eoo() ? 0 : result["code"].Int());
924
                        }
924
                        }
Lines 984-990 Link Here
984
984
985
                            if (!result["err"].eoo() && result["err"].type() == String &&
985
                            if (!result["err"].eoo() && result["err"].type() == String &&
986
                                (_config->throwGLE || op.throwGLE))
986
                                (_config->throwGLE || op.throwGLE))
987
			      throw DBException((std::string) "From benchRun GLE" +
987
                                throw DBException((std::string) "From benchRun GLE" +
988
                                                      causedBy(result["err"].String()),
988
                                                      causedBy(result["err"].String()),
989
                                                  result["code"].eoo() ? 0 : result["code"].Int());
989
                                                  result["code"].eoo() ? 0 : result["code"].Int());
990
                        }
990
                        }
Lines 1031-1037 Link Here
1031
1031
1032
                            if (!result["err"].eoo() && result["err"].type() == String &&
1032
                            if (!result["err"].eoo() && result["err"].type() == String &&
1033
                                (_config->throwGLE || op.throwGLE))
1033
                                (_config->throwGLE || op.throwGLE))
1034
			      throw DBException((std::string) "From benchRun GLE " +
1034
                                throw DBException((std::string) "From benchRun GLE " +
1035
                                                      causedBy(result["err"].String()),
1035
                                                      causedBy(result["err"].String()),
1036
                                                  result["code"].eoo() ? 0 : result["code"].Int());
1036
                                                  result["code"].eoo() ? 0 : result["code"].Int());
1037
                        }
1037
                        }
Lines 1133-1139 Link Here
1133
    try {
1133
    try {
1134
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1134
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1135
        if (!_config->username.empty()) {
1135
        if (!_config->username.empty()) {
1136
	  std::string errmsg;
1136
            std::string errmsg;
1137
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1137
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1138
                uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
1138
                uasserted(15932, "Authenticating to connection for benchThread failed: " + errmsg);
1139
            }
1139
            }
Lines 1165-1171 Link Here
1165
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1165
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1166
        // Must authenticate to admin db in order to run serverStatus command
1166
        // Must authenticate to admin db in order to run serverStatus command
1167
        if (_config->username != "") {
1167
        if (_config->username != "") {
1168
	  std::string errmsg;
1168
            std::string errmsg;
1169
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1169
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1170
                uasserted(
1170
                uasserted(
1171
                    16704,
1171
                    16704,
Lines 1201-1207 Link Here
1201
    {
1201
    {
1202
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1202
        std::unique_ptr<DBClientBase> conn(_config->createConnection());
1203
        if (_config->username != "") {
1203
        if (_config->username != "") {
1204
	  std::string errmsg;
1204
            std::string errmsg;
1205
            // this can only fail if admin access was revoked since start of run
1205
            // this can only fail if admin access was revoked since start of run
1206
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1206
            if (!conn->auth("admin", _config->username, _config->password, errmsg)) {
1207
                uasserted(
1207
                uasserted(
(-)mongodb-src-r3.4.4/src/mongo/util/net/miniwebserver.cpp (+1 lines)
Lines 47-52 Link Here
47
using std::shared_ptr;
47
using std::shared_ptr;
48
using std::stringstream;
48
using std::stringstream;
49
using std::vector;
49
using std::vector;
50
using std::string;
50
51
51
MiniWebServer::MiniWebServer(const string& name, const string& ip, int port, ServiceContext* ctx)
52
MiniWebServer::MiniWebServer(const string& name, const string& ip, int port, ServiceContext* ctx)
52
    : Listener(name, ip, port, ctx, false, false) {}
53
    : Listener(name, ip, port, ctx, false, false) {}

Return to bug 625148