Exemplo n.º 1
0
func (this *JSConverter) VisitIsNull(expr *expression.IsNull) (interface{}, error) {
	var buf bytes.Buffer
	buf.WriteString("(")
	buf.WriteString(this.Visit(expr.Operand()))
	buf.WriteString(" == null)")
	return buf.String(), nil
}
Exemplo n.º 2
0
func newSargNull(expr *expression.IsNull) *sargNull {
	rv := &sargNull{}
	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 _NULL_SPANS, nil
	}

	return rv
}