[Bug](function) positive function coredump in decimal (#16230)

This commit is contained in:
HappenLee
2023-01-30 22:17:50 +08:00
committed by GitHub
parent 75c8670286
commit 1020fe165b

View File

@ -54,14 +54,17 @@ template <typename>
struct AbsImpl;
template <typename>
struct NegativeImpl;
template <typename>
struct PositiveImpl;
/// Used to indicate undefined operation
struct InvalidType;
template <template <typename> class Op, typename Name, bool is_injective>
class FunctionUnaryArithmetic : public IFunction {
static constexpr bool allow_decimal =
std::is_same_v<Op<Int8>, NegativeImpl<Int8>> || std::is_same_v<Op<Int8>, AbsImpl<Int8>>;
static constexpr bool allow_decimal = std::is_same_v<Op<Int8>, NegativeImpl<Int8>> ||
std::is_same_v<Op<Int8>, AbsImpl<Int8>> ||
std::is_same_v<Op<Int8>, PositiveImpl<Int8>>;
template <typename F>
static bool cast_type(const IDataType* type, F&& f) {