diff --git a/pkg/util/ranger/ranger.go b/pkg/util/ranger/ranger.go index 1f6255dc31223..5d2d0a9edc8aa 100644 --- a/pkg/util/ranger/ranger.go +++ b/pkg/util/ranger/ranger.go @@ -735,10 +735,8 @@ func points2EqOrInCond(ctx expression.BuildContext, points []*point, col *expres retType := col.GetType(ctx.GetEvalCtx()) args := make([]expression.Expression, 0, len(points)/2) args = append(args, col) - if len(points) == 2 { - if points[0].value.IsNull() && points[0].value.IsNull() { - return expression.NewFunctionInternal(ctx, ast.IsNull, retType, args...) - } + if len(points) == 2 && points[0].value.IsNull() && points[0].value.IsNull() { + return expression.NewFunctionInternal(ctx, ast.IsNull, retType, args...) } for i := 0; i < len(points); i = i + 2 { value := &expression.Constant{