Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: impl/memory/datastore_index_selection.go

Issue 1309803004: Add transaction buffer filter. (Closed) Base URL: https://github.com/luci/gae.git@add_query_support
Patch Set: Fix builtin+ancestor+multi-eq+multiIterator bug, add more txnBuf test Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: impl/memory/datastore_index_selection.go
diff --git a/impl/memory/datastore_index_selection.go b/impl/memory/datastore_index_selection.go
index ad76bb7c04ddaa4f2bda4d4d7d9beb126e84e81c..c9d876f974535550ff78e067af9156230d153416 100644
--- a/impl/memory/datastore_index_selection.go
+++ b/impl/memory/datastore_index_selection.go
@@ -167,6 +167,9 @@ func (idxs *indexDefinitionSortableSlice) maybeAddDefinition(q *reducedQuery, s
if len(q.eqFilters) > 1 || (len(q.eqFilters) == 1 && q.eqFilters["__ancestor__"] == nil) {
return false
}
+ if len(sortBy) > 1 && q.eqFilters["__ancestor__"] != nil {
+ return false
+ }
}
// Make sure the equalities section doesn't contain any properties we don't
@@ -387,7 +390,7 @@ func generate(q *reducedQuery, idx *indexDefinitionSortable, c *constraints) *it
"start suffix for implied ancestor doesn't start with ancestor! start:%v ancestor:%v",
def.start, chopped))
}
- def.start = def.start[:offset+len(chopped)]
+ def.start = def.start[offset+len(chopped):]
Vadim Sh. 2015/09/28 18:52:56 diffs like this look scary.. Was there a bug here?
iannucci 2015/09/29 03:21:37 Yeah there was. I fixed the tests for this too. Ba
}
if def.end != nil {
offset := 0
@@ -400,7 +403,7 @@ func generate(q *reducedQuery, idx *indexDefinitionSortable, c *constraints) *it
"end suffix for implied ancestor doesn't start with ancestor! end:%v ancestor:%v",
def.end, chopped))
}
- def.end = def.end[:offset+len(chopped)]
+ def.end = def.end[offset+len(chopped):]
}
}

Powered by Google App Engine
This is Rietveld 408576698