From 2ba6869d546f8e213b99c1ee09a458b259a56043 Mon Sep 17 00:00:00 2001 From: Martin Martinez Rivera Date: Fri, 12 Jul 2019 15:04:33 -0700 Subject: [PATCH] Return error instead of asserting in handleCompareFunction. The assumption is not actually true since a DropAll can happen after the first index check. --- worker/task.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/worker/task.go b/worker/task.go index 8606aed4808..a3b94977d43 100644 --- a/worker/task.go +++ b/worker/task.go @@ -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())