MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / filterAttempt

Function filterAttempt

pkg/sql/sem/tree/overload.go:744–760  ·  view source on GitHub ↗

filterAttempt attempts to filter the overloads down to a single candidate. If it succeeds, it will return true, along with the overload (in a slice for convenience) and a possible error. If it fails, it will return false and undo any filtering performed during the attempt.

(
	ctx *SemaContext, s *typeCheckOverloadState, attempt func(),
)

Source from the content-addressed store, hash-verified

742// convenience) and a possible error. If it fails, it will return false and
743// undo any filtering performed during the attempt.
744func filterAttempt(
745 ctx *SemaContext, s *typeCheckOverloadState, attempt func(),
746) (ok bool, _ []TypedExpr, _ []overloadImpl, _ error) {
747 before := s.overloadIdxs
748 attempt()
749 if len(s.overloadIdxs) == 1 {
750 ok, typedExprs, fns, err := checkReturn(ctx, s)
751 if err != nil {
752 return false, nil, nil, err
753 }
754 if ok {
755 return true, typedExprs, fns, err
756 }
757 }
758 s.overloadIdxs = before
759 return false, nil, nil, nil
760}
761
762// filterOverloads filters overloads which do not satisfy the predicate.
763func filterOverloads(

Callers 1

typeCheckOverloadedExprsFunction · 0.85

Calls 1

checkReturnFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…