func NullsafeAdd(v1, v2 Value, resultType querypb.Type, prec int) (Value, error) {
	if v1.IsNull() {
		return v2, nil
	}
	if v2.IsNull() {
		return v1, nil
	}
	lv1, err := newNumeric(v1)
	if err != nil {
		return NULL, err
	}
	lv2, err := newNumeric(v2)
	if err != nil {
		return NULL, err
	}
	res, err := addNumeric(lv1, lv2)
	if err != nil {
		return NULL, err
	}
	return castFromNumeric(res, resultType, prec)
}
NullsafeAdd adds two Values in a null-safe manner. A null value
is treated as 0. If both values are null, then a null is returned.
If both values are not null, a numeric value is built
from each input: Signed->int64, Unsigned->uint64, Float->float64, Decimal->Decimal.
Otherwise the 'best type fit' is chosen for the number: int64 or float64.
Addition is performed by upgrading types as needed, or in case
of overflow: int64->uint64, int64->float64, uint64->float64.
Unsigned ints can only be added to positive ints. After the
addition, if one of the input types was Decimal, then
a Decimal is built. Otherwise, the final type of the
result is preserved.
package sqltypes
import (
	"bytes"
	"fmt"
	"math"
	"strconv"
	"github.com/shopspring/decimal"
	"github.com/xelabs/go-mysqlstack/sqlparser/depends/common"
	querypb "github.com/xelabs/go-mysqlstack/sqlparser/depends/query"
)
type numeric struct {
	typ  querypb.Type
	ival int64
	uval uint64
	fval float64
	dval decimal.Decimal
}