Chromium Code Reviews| 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):] |
| } |
| } |