MCPcopy Create free account
hub / github.com/dolthub/doltgresql / valuesEqual

Method valuesEqual

server/expression/in_subquery.go:131–148  ·  view source on GitHub ↗

valuesEqual returns true if the left value is equal to the row provided using the equality functions previously assigned to |compFuncs| during analysis. If the left value is a single scalar, then |row| has a single value as well. Otherwise, (left is a tuple), |row| has a matching number of values.

(ctx *sql.Context, left interface{}, row sql.Row)

Source from the content-addressed store, hash-verified

129// assigned to |compFuncs| during analysis. If the left value is a single scalar, then |row| has a single value as
130// well. Otherwise, (left is a tuple), |row| has a matching number of values.
131func (in *InSubquery) valuesEqual(ctx *sql.Context, left interface{}, row sql.Row) (bool, error) {
132 // Note that we have to edit the literals in place, since the comparison functions reference them directly.
133 in.leftLiteral.Val = left
134 for i, v := range row {
135 in.rightLiterals[i].Val = v
136 }
137
138 for _, compFunc := range in.compFuncs {
139 result, err := compFunc.Eval(ctx, nil)
140 if err != nil {
141 return false, err
142 }
143 if !result.(bool) {
144 return false, nil
145 }
146 }
147 return true, nil
148}
149
150// IsNullable implements the sql.Expression interface.
151func (in *InSubquery) IsNullable(ctx *sql.Context) bool {

Callers 1

EvalMethod · 0.95

Calls 1

EvalMethod · 0.65

Tested by

no test coverage detected