fix real-time mview can not get unrefreshed rows when use prepare protocol

This commit is contained in:
chimyue
2024-05-10 10:29:46 +00:00
committed by ob-robot
parent 1a647628f1
commit db7e8aedd6
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ int ObTransformMVRewrite::need_transform(const common::ObIArray<ObParentDMLStmt>
OPT_TRACE("only do mv rewrite in the first iteration");
} else if (stmt.is_select_stmt() && static_cast<const ObSelectStmt*>(&stmt)->is_expanded_mview()) {
need_trans = false;
} else if (ctx_->session_info_->is_inner() || !ctx_->session_info_->is_user_session()) {
} else if (ctx_->session_info_->get_ddl_info().is_refreshing_mview()) {
need_trans = false;
OPT_TRACE("not a user SQL, skip mv rewrite");
} else if (stmt.get_query_ctx()->optimizer_features_enable_version_ < COMPAT_VERSION_4_3_1) {

View File

@ -364,7 +364,7 @@ int ObTransformPreProcess::expand_materialized_view(ObDMLStmt *stmt, bool &trans
if (OB_ISNULL(stmt) || OB_ISNULL(ctx_) || OB_ISNULL(ctx_->session_info_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpect null", K(ret), K(stmt), K(ctx_));
} else if (ctx_->session_info_->is_inner()) {
} else if (ctx_->session_info_->get_ddl_info().is_refreshing_mview()) {
// when refresh mview, do not expand rt-mv
} else if (NULL != (hint = stmt->get_stmt_hint().get_normal_hint(T_MV_REWRITE))
&& hint->is_disable_hint()) {