mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Update StorageMaterializedView.cpp
This commit is contained in:
parent
05e4c8d3ef
commit
39d55556b8
@ -76,9 +76,10 @@ StorageMaterializedView::StorageMaterializedView(
|
||||
storage_metadata.setSelectQuery(select);
|
||||
setInMemoryMetadata(storage_metadata);
|
||||
|
||||
bool point_to_itself_by_uuid = has_inner_table && query.to_inner_uuid == table_id_.uuid;
|
||||
bool point_to_itself_by_name = has_inner_table && query.to_table_id.database_name == table_id_.database_name
|
||||
&& query.to_table_id.table_name == table_id_.table_name;
|
||||
bool point_to_itself_by_uuid = has_inner_table && query.to_inner_uuid != UUIDHelpers::Nil
|
||||
&& query.to_inner_uuid == table_id_.uuid;
|
||||
bool point_to_itself_by_name = !has_inner_table && query.to_table_id.database_name == table_id_.database_name
|
||||
&& query.to_table_id.table_name == table_id_.table_name;
|
||||
if (point_to_itself_by_uuid || point_to_itself_by_name)
|
||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Materialized view {} cannot point to itself", table_id_.getFullTableName());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user