Fix uninitialized memory in conversion

This commit is contained in:
Alexey Milovidov 2020-05-30 19:21:14 +03:00
parent 6468d7af8c
commit 326d2f9af8

View File

@ -145,6 +145,8 @@ struct ConvertImpl
vec_to[i] = convertFromDecimal<FromDataType, ToDataType>(vec_from[i], vec_from.getScale()); vec_to[i] = convertFromDecimal<FromDataType, ToDataType>(vec_from[i], vec_from.getScale());
else if constexpr (IsDataTypeNumber<FromDataType> && IsDataTypeDecimal<ToDataType>) else if constexpr (IsDataTypeNumber<FromDataType> && IsDataTypeDecimal<ToDataType>)
vec_to[i] = convertToDecimal<FromDataType, ToDataType>(vec_from[i], vec_to.getScale()); vec_to[i] = convertToDecimal<FromDataType, ToDataType>(vec_from[i], vec_to.getScale());
else
throw Exception("Unsupported data type in conversion function", ErrorCodes::NOT_IMPLEMENTED);
} }
else else
vec_to[i] = static_cast<ToFieldType>(vec_from[i]); vec_to[i] = static_cast<ToFieldType>(vec_from[i]);