summaryrefslogtreecommitdiff
path: root/jstests/core
diff options
context:
space:
mode:
authorDenis Grebennicov <denis.grebennicov@mongodb.com>2022-03-11 12:09:22 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-06 11:35:47 +0000
commit0e529d053e0275df760955b3215b90353bde560c (patch)
tree943252d711b203a1e73e87e10333804937c5bd26 /jstests/core
parent5aa29710a1780f13cb872f7706756d15affacb5f (diff)
downloadmongo-0e529d053e0275df760955b3215b90353bde560c.tar.gz
SERVER-64403 Encode the sort key from a document with collation only if value is present when comparing a sort key from index with one from the document in SORT_MERGE stage.
Diffstat (limited to 'jstests/core')
-rw-r--r--jstests/core/merge_sort_collation.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/jstests/core/merge_sort_collation.js b/jstests/core/merge_sort_collation.js
index a49dffc765a..ae571e43477 100644
--- a/jstests/core/merge_sort_collation.js
+++ b/jstests/core/merge_sort_collation.js
@@ -263,33 +263,33 @@ const testCases = [
// collation of the indexes. Also, the second/third operands to $or queries on fields
// 'e'/'g' that are not covered by the indexes therefore triggers addition of a FETCH stage
// between MERGE_SORT and IXSCAN. This tests comparison of index versus fetched document
- // provided sort keys. In addition to that, some documents have objects as sort attribute
- // values.
+ // provided sort keys. In addition to that, some documents have missing values and objects
+ // as sort attribute values.
indexes: [{a: 1, b: 1, c: 1}, {d: 1, c: 1}, {f: 1, c: 1}],
indexOptions: {collation: {locale: "en", strength: 2}},
filter: {$or: [{a: {$in: ["1", "2"]}, b: "1"}, {d: "3", e: "3"}, {f: "4", g: "3"}]},
sort: {c: 1},
findCollation: {locale: "en", strength: 2},
inputDocuments: [
- {_id: 0, a: "1", b: "1", c: "a"},
- {_id: 1, a: "1", b: "1", c: "d"},
- {_id: 2, a: "2", b: "1", c: "b"},
- {_id: 3, a: "2", b: "1", c: "e"},
- {_id: 6, a: "2", b: "1", c: {a: "B"}},
+ {_id: 0, d: "3", e: "3", c: "a"},
+ {_id: 1, d: "3", e: "3", c: "b"},
+ {_id: 2, d: "3", e: "3"},
+ {_id: 3, d: "3", e: "3", c: {}},
{_id: 4, d: "3", e: "3", c: "c"},
- {_id: 5, d: "3", e: "3", c: "f"},
+ {_id: 5, d: "3", e: "3", c: 1},
+ {_id: 6, a: "2", b: "1", c: {a: "B"}},
{_id: 7, d: "3", e: "3", c: {a: "A"}},
{_id: 8, d: "3", e: "3", c: {a: "C"}},
- {_id: 9, f: "4", g: "3", c: "g"},
+ {_id: 9, f: "4", g: "3", c: "d"},
],
expectedResults: [
- {_id: 0, a: "1", b: "1", c: "a"},
- {_id: 2, a: "2", b: "1", c: "b"},
+ {_id: 2, d: "3", e: "3"},
+ {_id: 5, d: "3", e: "3", c: 1},
+ {_id: 0, d: "3", e: "3", c: "a"},
+ {_id: 1, d: "3", e: "3", c: "b"},
{_id: 4, d: "3", e: "3", c: "c"},
- {_id: 1, a: "1", b: "1", c: "d"},
- {_id: 3, a: "2", b: "1", c: "e"},
- {_id: 5, d: "3", e: "3", c: "f"},
- {_id: 9, f: "4", g: "3", c: "g"},
+ {_id: 9, f: "4", g: "3", c: "d"},
+ {_id: 3, d: "3", e: "3", c: {}},
{_id: 7, d: "3", e: "3", c: {a: "A"}},
{_id: 6, a: "2", b: "1", c: {a: "B"}},
{_id: 8, d: "3", e: "3", c: {a: "C"}},