0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

SERVER-42609 Fix query_oplogreplay test for ephemeralTest record store

This commit is contained in:
Xin Hao Zhang 2019-08-02 08:50:50 -04:00
parent e6ef0ca20e
commit ba434d7651

View File

@ -39,7 +39,7 @@ function makeTS(i) {
}
for (let i = 1; i <= 100; i++) {
assert.writeOK(t.insert({_id: i, ts: makeTS(i)}));
assert.commandWorked(t.insert({_id: i, ts: makeTS(i)}));
}
// A $gt query on just the 'ts' field should return the next document after the timestamp.
@ -235,22 +235,24 @@ collScanStage = getPlanStage(res.executionStats.executionStages, "COLLSCAN");
assert.neq(null, collScanStage, "no collection scan found in explain output: " + tojson(res));
// We expect correct results when no collation specified and collection has a default collation.
const t_collation = db.getSiblingDB("local").oplog.jstests_query_oplogreplay_collation;
dropOplogAndCreateNew(t_collation,
const testCollation = db.getSiblingDB("local").oplog.jstests_query_oplogreplay_collation;
dropOplogAndCreateNew(testCollation,
{collation: {locale: "en_US", strength: 2}, capped: true, size: 16 * 1024});
assert.writeOK(t_collation.insert({str: "FOO", ts: Timestamp(1000, 0)}));
assert.writeOK(t_collation.insert({str: "FOO", ts: Timestamp(1000, 1)}));
assert.writeOK(t_collation.insert({str: "FOO", ts: Timestamp(1000, 2)}));
assert.eq(2, t_collation.find({str: "foo", ts: {$gte: Timestamp(1000, 1)}}).itcount());
assert.commandWorked(testCollation.insert({str: "FOO", ts: Timestamp(1000, 0)}));
assert.commandWorked(testCollation.insert({str: "FOO", ts: Timestamp(1000, 1)}));
assert.commandWorked(testCollation.insert({str: "FOO", ts: Timestamp(1000, 2)}));
assert.eq(2, testCollation.find({str: "foo", ts: {$gte: Timestamp(1000, 1)}}).itcount());
// We expect correct results when "simple" collation specified and collection has a default
// collation.
assert.writeOK(t_collation.insert({str: "FOO", ts: Timestamp(1000, 0)}));
assert.writeOK(t_collation.insert({str: "FOO", ts: Timestamp(1000, 1)}));
assert.writeOK(t_collation.insert({str: "FOO", ts: Timestamp(1000, 2)}));
dropOplogAndCreateNew(testCollation,
{collation: {locale: "en_US", strength: 2}, capped: true, size: 16 * 1024});
assert.commandWorked(testCollation.insert({str: "FOO", ts: Timestamp(1000, 0)}));
assert.commandWorked(testCollation.insert({str: "FOO", ts: Timestamp(1000, 1)}));
assert.commandWorked(testCollation.insert({str: "FOO", ts: Timestamp(1000, 2)}));
assert.eq(0,
t_collation.find({str: "foo", ts: {$gte: Timestamp(1000, 1)}})
testCollation.find({str: "foo", ts: {$gte: Timestamp(1000, 1)}})
.collation({locale: "simple"})
.itcount());
}());