pullup_expr & replace_const outline failed bugfix

This commit is contained in:
obdev
2023-05-08 09:42:16 +00:00
committed by ob-robot
parent 4b3e342312
commit 067d7b6846
2 changed files with 16 additions and 1 deletions

View File

@ -294,6 +294,21 @@ int ObTransformConstPropagate::do_transform(ObDMLStmt *stmt,
}
}
if (OB_SUCC(ret) && !const_ctx.active_const_infos_.empty() &&
(stmt->is_insert_stmt() || stmt->is_merge_stmt())) {
is_happened = false;
ObDelUpdStmt *insert = static_cast<ObDelUpdStmt *>(stmt);
if (OB_FAIL(collect_equal_pair_from_condition(stmt,
insert->get_sharding_conditions(),
const_ctx,
is_happened))) {
LOG_WARN("failed to collect const info from sharding condition", K(ret));
} else {
trans_happened |= is_happened;
LOG_TRACE("succeed to do const propagation while collect from sharding", K(is_happened));
}
}
if (OB_SUCC(ret) && !const_ctx.active_const_infos_.empty() &&
(stmt->is_insert_stmt() || stmt->is_merge_stmt())) {
ObDelUpdStmt *insert = static_cast<ObDelUpdStmt *>(stmt);

View File

@ -173,7 +173,7 @@ int ObTransformExprPullup::need_transform(const ObIArray<ObParentDMLStmt> &paren
need_trans = false;
OPT_TRACE("outline reject transform");
} else {
for (int64_t i = 0; OB_SUCC(ret) && i < stmt.get_table_size(); ++i) {
for (int64_t i = 0; !need_trans && OB_SUCC(ret) && i < stmt.get_table_size(); ++i) {
const TableItem *table = NULL;
if (OB_ISNULL(table = stmt.get_table_item(i))) {
ret = OB_ERR_UNEXPECTED;