File tree Expand file tree Collapse file tree
src/Storages/MaterializedView Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,6 +207,8 @@ void RefreshTask::checkAlterIsPossible(const DB::ASTRefreshStrategy & new_strate
207207
208208void RefreshTask::alterRefreshParams (const DB::ASTRefreshStrategy & new_strategy)
209209{
210+ StorageID view_storage_id = StorageID::createEmpty ();
211+
210212 {
211213 std::lock_guard guard (mutex);
212214
@@ -225,9 +227,17 @@ void RefreshTask::alterRefreshParams(const DB::ASTRefreshStrategy & new_strategy
225227 refresh_settings = {};
226228 if (new_strategy.settings != nullptr )
227229 refresh_settings.applyChanges (new_strategy.settings ->changes );
230+
231+ if (view)
232+ view_storage_id = view->getStorageID ();
228233 }
234+
229235 // / In case refresh period changed.
230- view->getContext ()->getRefreshSet ().notifyDependents (view->getStorageID ());
236+ if (view_storage_id)
237+ {
238+ const auto & refresh_set = Context::getGlobalContextInstance ()->getRefreshSet ();
239+ refresh_set.notifyDependents (view_storage_id);
240+ }
231241}
232242
233243RefreshTask::Info RefreshTask::getInfo () const
You can’t perform that action at this time.
0 commit comments