mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Backport #71556 to 24.10: Fix compatibility with refreshable materialized views created by old clickhouse servers
This commit is contained in:
parent
b3f043cafd
commit
c8b606895d
@ -228,10 +228,20 @@ StorageMaterializedView::StorageMaterializedView(
|
|||||||
|
|
||||||
if (!fixed_uuid)
|
if (!fixed_uuid)
|
||||||
{
|
{
|
||||||
if (to_inner_uuid != UUIDHelpers::Nil)
|
if (mode >= LoadingStrictnessLevel::ATTACH)
|
||||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "TO INNER UUID is not allowed for materialized views with REFRESH without APPEND");
|
{
|
||||||
if (to_table_id.hasUUID())
|
/// Old versions of ClickHouse (when refreshable MV was experimental) could add useless
|
||||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "explicit UUID is not allowed for target table of materialized view with REFRESH without APPEND");
|
/// UUIDs to attach queries.
|
||||||
|
to_table_id.uuid = UUIDHelpers::Nil;
|
||||||
|
to_inner_uuid = UUIDHelpers::Nil;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (to_inner_uuid != UUIDHelpers::Nil)
|
||||||
|
throw Exception(ErrorCodes::BAD_ARGUMENTS, "TO INNER UUID is not allowed for materialized views with REFRESH without APPEND");
|
||||||
|
if (to_table_id.hasUUID())
|
||||||
|
throw Exception(ErrorCodes::BAD_ARGUMENTS, "explicit UUID is not allowed for target table of materialized view with REFRESH without APPEND");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!has_inner_table)
|
if (!has_inner_table)
|
||||||
|
Loading…
Reference in New Issue
Block a user