diff options
Diffstat (limited to 'jstests/core/query')
| -rw-r--r-- | jstests/core/query/internal_strip_invalid_assignment.js | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/jstests/core/query/internal_strip_invalid_assignment.js b/jstests/core/query/internal_strip_invalid_assignment.js deleted file mode 100644 index b8868c6e951..00000000000 --- a/jstests/core/query/internal_strip_invalid_assignment.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Test that '$_internalSchemaAllElemMatchFromIndex' does not use an index, and does not trigger an - * assertion failure when we strip its index assignment from special indexes. - * - * Originally intended to reproduce SERVER-82717. - * - * @tags: [ - * # Explain command does not support read concerns other than local. - * assumes_read_concern_local, - * ] - */ -(function() { -load('jstests/libs/analyze_plan.js'); // for planHasStage - -const coll = db.getCollection(jsTestName()); - -assert.commandWorked(coll.createIndex({a: 1, foo: '2dsphere'})); -assert.commandWorked(coll.createIndex({a: 1, '$**': 'text'})); -assert.commandWorked(coll.createIndex({a: 1}, {partialFilterExpression: {foo: 123}})); - -const query = { - "$or": [ - // Has to be the same field. - {"a": 1}, - { - "a": { - // Checks that ALL elements of an array match this predicate. - // An index on {a: 1, ...} doesn't help, because: - // - If it's multikey, each index entry only tells us one array-element, while - // the predicate needs to check all elements. - // - If it's non-multikey, the predicate is trivially false, because it expects - // an array. - "$_internalSchemaAllElemMatchFromIndex": [ - // Number of elements to skip. - NumberLong(0), - // Predicate to run on each element. - {"i": {"$regex": "b"}}, - ] - } - } - ] -}; -const explain = coll.find(query).explain(); -assert(planHasStage(db, explain, "COLLSCAN"), explain); -})(); |
