func (f *NullIf) IsNullable() bool {
	return true
}
IsNullable implements the Expression interface.
package function
import (
	"fmt"
	"github.com/src-d/go-mysql-server/sql"
	"github.com/src-d/go-mysql-server/sql/expression"
)
type NullIf struct {
	expression.BinaryExpression
}
func NewNullIf(ex1, ex2 sql.Expression) sql.Expression {
	return &NullIf{
		expression.BinaryExpression{
			Left:  ex1,
			Right: ex2,
		},
	}
}
func (f *NullIf) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
	if sql.IsNull(f.Left) && sql.IsNull(f.Right) {
		return sql.Null, nil
	}
	val, err := expression.NewEquals(f.Left, f.Right).Eval(ctx, row)
	if err != nil {
		return nil, err
	}
	if b, ok := val.(bool); ok && b {
		return sql.Null, nil
	}
	return f.Left.Eval(ctx, row)
}
func (f *NullIf) Type() sql.Type {
	if sql.IsNull(f.Left) {
		return sql.Null
	}
	return f.Left.Type()
}