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

Unified Diff: impl/memory/datastore_query_execution.go

Issue 1894403002: datastore: Fix AddIndexes with existing namespaces (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « impl/memory/datastore_index.go ('k') | impl/memory/datastore_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/datastore_query_execution.go
diff --git a/impl/memory/datastore_query_execution.go b/impl/memory/datastore_query_execution.go
index 4c6b2cc6c3470b8a03170a3a81e502b5f4944ffb..776a0a7ca3897c826cc8fb97d3d00c2cb5566f9e 100644
--- a/impl/memory/datastore_query_execution.go
+++ b/impl/memory/datastore_query_execution.go
@@ -8,7 +8,6 @@ import (
"bytes"
"errors"
"fmt"
- "strings"
ds "github.com/luci/gae/service/datastore"
"github.com/luci/gae/service/datastore/serialize"
@@ -189,8 +188,6 @@ func executeNamespaceQuery(fq *ds.FinalizedQuery, aid string, head *memStore, cb
if !(fq.IneqFilterProp() == "" || fq.IneqFilterProp() == "__key__") {
return nil
}
- colls := head.GetCollectionNames()
- foundEnts := false
limit, hasLimit := fq.Limit()
offset, hasOffset := fq.Offset()
start, end := fq.Bounds()
@@ -200,14 +197,7 @@ func executeNamespaceQuery(fq *ds.FinalizedQuery, aid string, head *memStore, cb
if !(start == nil && end == nil) {
return cursErr
}
- for _, c := range colls {
- if !strings.HasPrefix(c, "ents:") {
- if foundEnts {
- break
- }
- continue
- }
- foundEnts = true
+ for _, ns := range namespaces(head) {
if hasOffset && offset > 0 {
offset--
continue
@@ -219,7 +209,6 @@ func executeNamespaceQuery(fq *ds.FinalizedQuery, aid string, head *memStore, cb
limit--
}
k := (*ds.Key)(nil)
- ns := c[len("ents:"):]
if ns == "" {
// Datastore uses an id of 1 to indicate the default namespace in its
// metadata API.
« no previous file with comments | « impl/memory/datastore_index.go ('k') | impl/memory/datastore_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698