@@ -67,6 +67,10 @@ public abstract class QueryEngineTestCase {
67
67
doc ("coll/a" , 1 , map ("matches" , true , "order" , 1 ));
68
68
private static final MutableDocument NON_MATCHING_DOC_A =
69
69
doc ("coll/a" , 1 , map ("matches" , false , "order" , 1 ));
70
+ private static final MutableDocument PENDING_MATCHING_DOC_A =
71
+ doc ("coll/a" , 1 , map ("matches" , true , "order" , 1 )).setHasLocalMutations ();
72
+ private static final MutableDocument PENDING_NON_MATCHING_DOC_A =
73
+ doc ("coll/a" , 1 , map ("matches" , false , "order" , 1 )).setHasLocalMutations ();
70
74
private static final MutableDocument UPDATED_DOC_A =
71
75
doc ("coll/a" , 11 , map ("matches" , true , "order" , 1 ));
72
76
private static final MutableDocument MATCHING_DOC_B =
@@ -230,7 +234,7 @@ public void filtersNonMatchingInitialResults() throws Exception {
230
234
persistQueryMapping (MATCHING_DOC_A .getKey (), MATCHING_DOC_B .getKey ());
231
235
232
236
// Add a mutated document that is not yet part of query's set of remote keys.
233
- addDocumentWithEventVersion (version (1 ), NON_MATCHING_DOC_A );
237
+ addDocumentWithEventVersion (version (1 ), PENDING_NON_MATCHING_DOC_A );
234
238
235
239
DocumentSet docs =
236
240
expectOptimizedCollectionScan (() -> runQuery (query , LAST_LIMBO_FREE_SNAPSHOT ));
@@ -314,9 +318,9 @@ public void doesNotUseInitialResultsForLimitQueryWhenLastDocumentHasPendingWrite
314
318
315
319
// Add a query mapping for a document that matches, but that sorts below another document due to
316
320
// a pending write.
317
- addDocumentWithEventVersion (version (1 ), MATCHING_DOC_A );
321
+ addDocumentWithEventVersion (version (1 ), PENDING_MATCHING_DOC_A );
318
322
addMutation (DOC_A_EMPTY_PATCH );
319
- persistQueryMapping (MATCHING_DOC_A .getKey ());
323
+ persistQueryMapping (PENDING_MATCHING_DOC_A .getKey ());
320
324
321
325
addDocument (MATCHING_DOC_B );
322
326
@@ -335,9 +339,9 @@ public void doesNotUseInitialResultsForLimitToLastQueryWhenLastDocumentHasPendin
335
339
336
340
// Add a query mapping for a document that matches, but that sorts below another document due to
337
341
// a pending write.
338
- addDocumentWithEventVersion (version (1 ), MATCHING_DOC_A );
342
+ addDocumentWithEventVersion (version (1 ), PENDING_MATCHING_DOC_A );
339
343
addMutation (DOC_A_EMPTY_PATCH );
340
- persistQueryMapping (MATCHING_DOC_A .getKey ());
344
+ persistQueryMapping (PENDING_MATCHING_DOC_A .getKey ());
341
345
342
346
addDocument (MATCHING_DOC_B );
343
347
0 commit comments