| 583 | } |
| 584 | |
| 585 | ContextMutablePtr StorageMaterializedView::createRefreshContext(const String & log_comment) const |
| 586 | { |
| 587 | ContextPtr table_context = getContext(); |
| 588 | ClientInfo client_info = table_context->getClientInfo(); |
| 589 | client_info.interface = ClientInfo::Interface::BACKGROUND; |
| 590 | client_info.client_name = "refreshable materialized view"; |
| 591 | auto view_metadata = getInMemoryMetadataPtr(getContext(), false); |
| 592 | auto refresh_context = view_metadata->getSQLSecurityOverriddenContext(table_context, &client_info); |
| 593 | refresh_context->setClientInfo(client_info); |
| 594 | refresh_context->setSetting("database_replicated_allow_replicated_engine_arguments", 3); |
| 595 | refresh_context->setSetting("log_comment", log_comment); |
| 596 | refresh_context->setQueryKind(ClientInfo::QueryKind::INITIAL_QUERY); |
| 597 | /// Generate a random query id. |
| 598 | refresh_context->setCurrentQueryId(""); |
| 599 | /// Use the database where the materialized view is created to run the select query in the refresh task |
| 600 | refresh_context->setCurrentDatabase(getStorageID().database_name); |
| 601 | return refresh_context; |
| 602 | } |
| 603 | |
| 604 | std::tuple<boost::intrusive_ptr<ASTInsertQuery>, QueryScope> |
| 605 | StorageMaterializedView::prepareRefresh(bool append, ContextMutablePtr refresh_context, std::optional<StorageID> & out_temp_table_id) const |
no test coverage detected