Skip to content

Commit

Permalink
Return error instead of asserting in handleCompareFunction. (#3665)
Browse files Browse the repository at this point in the history
The assumption is not actually true since a DropAll can happen after the
first index check.
  • Loading branch information
martinmr authored Jul 23, 2019
1 parent 7b94f15 commit 3423da8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worker/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,10 @@ func (qs *queryState) handleRegexFunction(ctx context.Context, arg funcArgs) err
func (qs *queryState) handleCompareFunction(ctx context.Context, arg funcArgs) error {
attr := arg.q.Attr
tokenizer, err := pickTokenizer(attr, arg.srcFn.fname)
// We should already have checked this in getInequalityTokens.
x.Check(err)
if err != nil {
return err
}

// Only if the tokenizer that we used IsLossy, then we need to fetch
// and compare the actual values.
if tokenizer.IsLossy() {
Expand Down

0 comments on commit 3423da8

Please sign in to comment.