Skip to content

Commit

Permalink
Return error instead of asserting in handleCompareFunction. (#3664)
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 16, 2019
1 parent 13a31a2 commit da7c455
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 @@ -1036,8 +1036,10 @@ func (qs *queryState) handleCompareFunction(ctx context.Context, arg funcArgs) e
attr := arg.q.Attr
span.Annotatef(nil, "Attr: %s. Fname: %s", attr, arg.srcFn.fname)
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.
span.Annotatef(nil, "Tokenizer: %s, Lossy: %t", tokenizer.Name(), tokenizer.IsLossy())
Expand Down

0 comments on commit da7c455

Please sign in to comment.