mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
Throw exception for invalid inputs
This commit is contained in:
parent
6a14502cbe
commit
20a0e7338e
@ -20,6 +20,7 @@ namespace ErrorCodes
|
||||
{
|
||||
extern const int CANNOT_RESTORE_FROM_FIELD_DUMP;
|
||||
extern const int DECIMAL_OVERFLOW;
|
||||
extern const int INCORRECT_DATA;
|
||||
}
|
||||
|
||||
template <is_decimal T>
|
||||
@ -28,7 +29,7 @@ T DecimalField<T>::getScaleMultiplier() const
|
||||
return DecimalUtils::scaleMultiplier<T>(scale);
|
||||
}
|
||||
|
||||
inline Field getBinaryValue(UInt8 type, ReadBuffer & buf)
|
||||
Field getBinaryValue(UInt8 type, ReadBuffer & buf)
|
||||
{
|
||||
switch (static_cast<Field::Types::Which>(type))
|
||||
{
|
||||
@ -146,7 +147,7 @@ inline Field getBinaryValue(UInt8 type, ReadBuffer & buf)
|
||||
case Field::Types::CustomType:
|
||||
return Field();
|
||||
}
|
||||
UNREACHABLE();
|
||||
throw Exception(ErrorCodes::INCORRECT_DATA, "Unknown field type {}", std::to_string(type));
|
||||
}
|
||||
|
||||
void readBinary(Array & x, ReadBuffer & buf)
|
||||
@ -575,7 +576,7 @@ template bool decimalLessOrEqual<Decimal256>(Decimal256 x, Decimal256 y, UInt32
|
||||
template bool decimalLessOrEqual<DateTime64>(DateTime64 x, DateTime64 y, UInt32 x_scale, UInt32 y_scale);
|
||||
|
||||
|
||||
inline void writeText(const Null & x, WriteBuffer & buf)
|
||||
void writeText(const Null & x, WriteBuffer & buf)
|
||||
{
|
||||
if (x.isNegativeInfinity())
|
||||
writeText("-Inf", buf);
|
||||
|
Loading…
Reference in New Issue
Block a user