mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #71629 from ClickHouse/backport/24.10/71556
Backport #71556 to 24.10: Fix compatibility with refreshable materialized views created by old clickhouse servers
This commit is contained in:
commit
bab90c1c39
@ -228,10 +228,20 @@ StorageMaterializedView::StorageMaterializedView(
|
||||
|
||||
if (!fixed_uuid)
|
||||
{
|
||||
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 (mode >= LoadingStrictnessLevel::ATTACH)
|
||||
{
|
||||
/// Old versions of ClickHouse (when refreshable MV was experimental) could add useless
|
||||
/// 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)
|
||||
|
Loading…
Reference in New Issue
Block a user