示例#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
}
示例#2
0
func newSargNull(pred *expression.IsNull) *sargNull {
	rv := &sargNull{}
	rv.sarger = func(expr2 expression.Expression) (plan.Spans, error) {
		if SubsetOf(pred, expr2) {
			return _SELF_SPANS, nil
		}

		if pred.Operand().EquivalentTo(expr2) {
			return _NULL_SPANS, nil
		}

		return nil, nil
	}

	return rv
}