Fixed bug in converting DateTime64 to string on large scale values

This commit is contained in:
Vasily Nemkov 2019-11-21 01:04:18 +03:00
parent 6dfe36479e
commit fa90406f25

View File

@ -375,7 +375,7 @@ struct ConvertImpl<FromDataType, std::enable_if_t<!std::is_same_v<FromDataType,
else if constexpr (std::is_same_v<FromDataType, DataTypeDateTime>)
data_to.resize(size * (strlen("YYYY-MM-DD hh:mm:ss") + 1));
else if constexpr (std::is_same_v<FromDataType, DataTypeDateTime64>)
data_to.resize(size * (strlen("YYYY-MM-DD hh:mm:ss.nnnnnnnnn") + 1));
data_to.resize(size * (strlen("YYYY-MM-DD hh:mm:ss.") + vec_from.getScale() + 1));
else
data_to.resize(size * 3); /// Arbitary