Fixed compile issues

This commit is contained in:
Maksim Kita 2020-11-15 22:24:15 +03:00
parent 7b66dc374c
commit dd072a20c9
4 changed files with 9 additions and 3 deletions

View File

@ -16,12 +16,16 @@ namespace ErrorCodes
extern const int UNKNOWN_ELEMENT_IN_CONFIG;
}
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wframe-larger-than="
#endif
IMPLEMENT_SETTINGS_TRAITS(SettingsTraits, LIST_OF_SETTINGS)
#if __clang__
#pragma clang diagnostic pop
#endif
/** Set the settings from the profile (in the server configuration, many settings can be listed in one profile).
* The profile can also be set using the `set` functions, like the `profile` setting.

View File

@ -2135,7 +2135,8 @@ private:
bool is_accurate_cast = is_accurate_cast_or_null;
return [is_accurate_cast, nullable_column_wrapper, from_type_index, to_type]
(ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, const ColumnNullable * column_nullable, size_t input_rows_count) {
(ColumnsWithTypeAndName & arguments, const DataTypePtr & result_type, const ColumnNullable *column_nullable, size_t input_rows_count)
{
ColumnPtr result_column;
auto res = callOnIndexAndDataType<ToDataType>(from_type_index, [&](const auto & types) -> bool {
using Types = std::decay_t<decltype(types)>;
@ -2264,7 +2265,7 @@ private:
{
if (is_accurate_cast_or_null)
return createToNullableColumnWrapper();
else
else
throw Exception{"Conversion from " + from_type_untyped->getName() + " to " + to_type->getName() +
" is not supported", ErrorCodes::CANNOT_CONVERT_TYPE};
}

View File

@ -4,6 +4,7 @@
1 Nullable(Int32)
2 Nullable(Float32)
2 Nullable(UInt8)
00000000-0000-0002-0000-000000000000 Nullable(UUID)
3 Nullable(Int32)
\N Nullable(Int32)
42 Nullable(Int32)

View File

@ -10,7 +10,7 @@ SELECT CAST(toNullable(toInt8(1)) AS Int32) as x, toTypeName(x);
SELECT CAST(toNullable(toFloat32(2)), 'Float32') as x, toTypeName(x);
SELECT CAST(toNullable(toFloat32(2)), 'UInt8') as x, toTypeName(x);
SELECT CAST(toNullable(toFloat32(2)), 'UUID') as x, toTypeName(x); -- { serverError 70 }
SELECT CAST(toNullable(toFloat32(2)), 'UUID') as x, toTypeName(x);
SELECT CAST(if(1 = 1, toNullable(toInt8(3)), NULL) AS Int32) as x, toTypeName(x);
SELECT CAST(if(1 = 0, toNullable(toInt8(3)), NULL) AS Int32) as x, toTypeName(x);