mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
fixed result data type init
This commit is contained in:
parent
1f67b0ce8d
commit
ea2da764f6
@ -990,7 +990,14 @@ public:
|
||||
static constexpr const bool dec_a = IsDecimalNumber<T0>;
|
||||
static constexpr const bool dec_b = IsDecimalNumber<T1>;
|
||||
|
||||
ResultDataType type = decimalResultType<is_multiply, is_division>(left, right);
|
||||
ResultDataType type;
|
||||
|
||||
if constexpr(dec_a && IsFloatingPoint<RightDataType>)
|
||||
type = RightDataType();
|
||||
else if constexpr(dec_b && IsFloatingPoint<LeftDataType>)
|
||||
type = LeftDataType();
|
||||
else
|
||||
type = decimalResultType<is_multiply, is_division>(left, right);
|
||||
|
||||
typename ResultDataType::FieldType scale_a = type.scaleFactorFor(left, is_multiply);
|
||||
typename ResultDataType::FieldType scale_b = type.scaleFactorFor(right, is_multiply || is_division);
|
||||
|
Loading…
Reference in New Issue
Block a user