You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Triggering query below, better repro soon. This one seems kind of strange, we explicitly check for and handle ErrNilOperand in Equals, RegExp, GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual. As far as I can tell, there are no unhandled filters in the queries below. The error type check may be failing.
This is a merge join bug, mergeJoinIter.peekMatch calls Compare without checking for a nil error:
diff --git a/sql/plan/merge_join.go b/sql/plan/merge_join.go
index 9f5910073..84287fa76 100644
--- a/sql/plan/merge_join.go+++ b/sql/plan/merge_join.go@@ -458,7 +458,10 @@ func (i *mergeJoinIter) peekMatch(ctx *sql.Context, iter sql.RowIter) (bool, sql
// check if lookahead valid
copySubslice(i.fullRow, peek, off)
res, err := i.cmp.Compare(ctx, i.fullRow)
- if err != nil {+ if expression.ErrNilOperand.Is(err) {+ // revert change to output row if no match+ copySubslice(i.fullRow, restore, off)+ } else if err != nil {
return false, nil, err
}
peekMatch is only called immediately after we have a merge join match, so reaching this code is not trivial. We need the indexes to have a matching row, and then immediately have a null field.
max-hoffman
changed the title
LEFT_OUTER_JOIN nil comparison found in operand
MERGE_JOIN nil comparison found in operand
Mar 28, 2023
Triggering query below, better repro soon. This one seems kind of strange, we explicitly check for and handle
ErrNilOperand
inEquals
,RegExp
,GreaterThan
,GreaterThanOrEqual
,LessThan
, andLessThanOrEqual
. As far as I can tell, there are no unhandled filters in the queries below. The error type check may be failing.error:
nil comparison found in operand
The text was updated successfully, but these errors were encountered: