Fixed build errors for GCC-9 and Apple Clang.

This commit is contained in:
Vasily Nemkov 2019-11-11 08:18:34 +03:00
parent 5c125dff90
commit d227712f84
3 changed files with 12 additions and 12 deletions

View File

@ -69,7 +69,7 @@ void DataTypeDateTime64::serializeText(const IColumn & column, size_t row_num, W
void DataTypeDateTime64::deserializeText(IColumn & column, ReadBuffer & istr, const FormatSettings &) const
{
DateTime64 result;
DateTime64 result = 0;
readDateTime64Text(result, this->getScale(), istr, time_zone);
assert_cast<ColumnType &>(column).getData().push_back(result);
}
@ -86,7 +86,7 @@ void DataTypeDateTime64::serializeTextEscaped(const IColumn & column, size_t row
void DataTypeDateTime64::deserializeTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
{
DateTime64 x;
DateTime64 x = 0;
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
assert_cast<ColumnType &>(column).getData().push_back(x);
}
@ -100,7 +100,7 @@ void DataTypeDateTime64::serializeTextQuoted(const IColumn & column, size_t row_
void DataTypeDateTime64::deserializeTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
{
DateTime64 x;
DateTime64 x = 0;
if (checkChar('\'', istr)) /// Cases: '2017-08-31 18:36:48' or '1504193808'
{
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
@ -122,7 +122,7 @@ void DataTypeDateTime64::serializeTextJSON(const IColumn & column, size_t row_nu
void DataTypeDateTime64::deserializeTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
{
DateTime64 x;
DateTime64 x = 0;
if (checkChar('"', istr))
{
::readText(x, scale, istr, settings, time_zone, utc_time_zone);
@ -144,7 +144,7 @@ void DataTypeDateTime64::serializeTextCSV(const IColumn & column, size_t row_num
void DataTypeDateTime64::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const
{
DateTime64 x;
DateTime64 x = 0;
if (istr.eof())
throwReadAfterEOF();
@ -172,7 +172,7 @@ void DataTypeDateTime64::serializeProtobuf(const IColumn & column, size_t row_nu
void DataTypeDateTime64::deserializeProtobuf(IColumn & column, ProtobufReader & protobuf, bool allow_add_row, bool & row_added) const
{
row_added = false;
DateTime64 t;
DateTime64 t = 0;
if (!protobuf.readDateTime64(t, scale))
return;

View File

@ -641,7 +641,7 @@ struct ConvertThroughParsing
{
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
{
DateTime64 res;
DateTime64 res = 0;
parseDateTime64BestEffort(res, vec_to.getScale(), read_buffer, *local_time_zone, *utc_time_zone);
vec_to[i] = res;
}
@ -656,7 +656,7 @@ struct ConvertThroughParsing
{
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
{
DateTime64 value;
DateTime64 value = 0;
readDateTime64Text(value, vec_to.getScale(), read_buffer, *local_time_zone);
vec_to[i] = value;
}
@ -677,7 +677,7 @@ struct ConvertThroughParsing
{
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
{
DateTime64 res;
DateTime64 res = 0;
parsed = tryParseDateTime64BestEffort(res, vec_to.getScale(), read_buffer, *local_time_zone, *utc_time_zone);
vec_to[i] = res;
}
@ -692,7 +692,7 @@ struct ConvertThroughParsing
{
if constexpr (std::is_same_v<ToDataType, DataTypeDateTime64>)
{
DateTime64 value;
DateTime64 value = 0;
parsed = tryReadDateTime64Text(value, vec_to.getScale(), read_buffer, *local_time_zone);
vec_to[i] = value;
}
@ -1132,7 +1132,7 @@ public:
res = std::make_shared<DataTypeDateTime>(extractTimeZoneNameFromFunctionArguments(arguments, 1, 0));
else if constexpr (to_decimal)
{
UInt64 scale = extractToDecimalScale(arguments[1]);
UInt64 scale [[maybe_unused]] = extractToDecimalScale(arguments[1]);
if constexpr (std::is_same_v<ToDataType, DataTypeDecimal<Decimal32>>)
res = createDecimal<DataTypeDecimal>(9, scale);

View File

@ -543,7 +543,7 @@ bool tryParseDateTimeBestEffort(time_t & res, ReadBuffer & in, const DateLUTImpl
void parseDateTime64BestEffort(DateTime64 & res, UInt32 scale, ReadBuffer & in, const DateLUTImpl & local_time_zone, const DateLUTImpl & utc_time_zone)
{
DateTime64::NativeType whole;
time_t whole;
DateTime64::NativeType fractional;
parseDateTimeBestEffortImpl<void>(whole, in, local_time_zone, utc_time_zone, &fractional);