Exemplo n.º 1
0
func newSargableUnary(expr expression.UnaryFunction) *sargableUnary {
	rv := &sargableUnary{}
	rv.test = func(expr2 expression.Expression) (bool, error) {
		return expr.Operand().EquivalentTo(expr2), nil
	}

	return rv
}
Exemplo n.º 2
0
func newSargValued(expr expression.UnaryFunction) *sargValued {
	rv := &sargValued{}
	rv.sarg = func(expr2 expression.Expression) (Spans, error) {
		if expr.EquivalentTo(expr2) {
			return _SELF_SPANS, nil
		}

		if !expr.Operand().EquivalentTo(expr2) {
			return nil, nil
		}

		return _VALUED_SPANS, nil
	}

	return rv
}