diff --git a/src/Core/Settings.cpp b/src/Core/Settings.cpp index 56ce951c014..ffca9181c70 100644 --- a/src/Core/Settings.cpp +++ b/src/Core/Settings.cpp @@ -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. diff --git a/src/Functions/FunctionsConversion.h b/src/Functions/FunctionsConversion.h index 4303588aae6..78bf586a32c 100644 --- a/src/Functions/FunctionsConversion.h +++ b/src/Functions/FunctionsConversion.h @@ -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(from_type_index, [&](const auto & types) -> bool { using Types = std::decay_t; @@ -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}; } diff --git a/tests/queries/0_stateless/01322_cast_keep_nullable.reference b/tests/queries/0_stateless/01322_cast_keep_nullable.reference index 8ad99a10170..cfe80a7c1b1 100644 --- a/tests/queries/0_stateless/01322_cast_keep_nullable.reference +++ b/tests/queries/0_stateless/01322_cast_keep_nullable.reference @@ -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) diff --git a/tests/queries/0_stateless/01322_cast_keep_nullable.sql b/tests/queries/0_stateless/01322_cast_keep_nullable.sql index 10918717469..ef5f5747a7d 100644 --- a/tests/queries/0_stateless/01322_cast_keep_nullable.sql +++ b/tests/queries/0_stateless/01322_cast_keep_nullable.sql @@ -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);