diff --git a/src/Storages/WindowView/StorageWindowView.cpp b/src/Storages/WindowView/StorageWindowView.cpp index 893e0eefb86..eb95a82d210 100644 --- a/src/Storages/WindowView/StorageWindowView.cpp +++ b/src/Storages/WindowView/StorageWindowView.cpp @@ -465,6 +465,9 @@ void StorageWindowView::alter( auto old_inner_table_id = inner_table_id; modifying_query = true; + SCOPE_EXIT({ + modifying_query = false; + }); shutdown(); auto inner_query = initInnerQuery(new_select_query->as(), local_context);