[scn] fix failure of mittest after refresh feature scn
This commit is contained in:
@ -356,8 +356,7 @@ int ObTransformViewMerge::check_semi_right_table_can_be_merged(ObDMLStmt *stmt,
|
||||
|| ref_query->is_contains_assignment()
|
||||
|| ref_query->has_sequence()
|
||||
|| ref_query->is_hierarchical_query()
|
||||
|| ref_query->has_ora_rowscn()
|
||||
|| (lib::is_mysql_mode() && ref_query->has_for_update())) {
|
||||
|| ref_query->has_ora_rowscn()) {
|
||||
can_be = false;
|
||||
} else if (OB_FAIL(ref_query->has_rownum(has_rownum))) {
|
||||
LOG_WARN("failed to check has rownum expr", K(ret));
|
||||
@ -482,13 +481,10 @@ int ObTransformViewMerge::check_basic_validity(ObDMLStmt *parent_stmt,
|
||||
bool &can_be) {
|
||||
int ret = OB_SUCCESS;
|
||||
can_be = false;
|
||||
bool has_assignment = false;
|
||||
bool has_rownum_expr = false;
|
||||
bool has_ref_assign_user_var = false;
|
||||
bool force_merge = false;
|
||||
bool force_no_merge = false;
|
||||
bool is_select_expr_valid = false;
|
||||
ObSEArray<ObRawExpr*, 8> select_exprs;
|
||||
if (OB_ISNULL(parent_stmt) || OB_ISNULL(child_stmt)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected null", K(ret));
|
||||
@ -509,25 +505,15 @@ int ObTransformViewMerge::check_basic_validity(ObDMLStmt *parent_stmt,
|
||||
|| !child_stmt->has_order_by())
|
||||
|| child_stmt->has_limit()
|
||||
|| child_stmt->get_aggr_item_size() != 0
|
||||
|| child_stmt->is_contains_assignment()
|
||||
|| child_stmt->has_window_function()
|
||||
|| child_stmt->has_sequence()
|
||||
|| child_stmt->has_ora_rowscn()) {
|
||||
can_be = false;
|
||||
} else if (OB_FAIL(ObTransformUtils::check_has_assignment(*child_stmt, has_assignment))) {
|
||||
LOG_WARN("check has assignment failed", K(ret));
|
||||
} else if (has_assignment) {
|
||||
can_be = false;
|
||||
} else if (OB_FAIL(child_stmt->has_rownum(has_rownum_expr))) {
|
||||
LOG_WARN("failed to check has rownum expr", K(ret));
|
||||
} else if (has_rownum_expr) {
|
||||
can_be = false;
|
||||
} else if (OB_FAIL(child_stmt->get_select_exprs(select_exprs))) {
|
||||
LOG_WARN("failed to get select exprs", K(ret));
|
||||
} else if (OB_FAIL(ObTransformUtils::check_expr_valid_for_stmt_merge(select_exprs,
|
||||
is_select_expr_valid))) {
|
||||
LOG_WARN("failed to check select expr valid", K(ret));
|
||||
} else if (!is_select_expr_valid) {
|
||||
can_be = false;
|
||||
} else if (0 == child_stmt->get_from_item_size()) {
|
||||
//当 view 为 select ... from dual, 若上层非层次查询, 允许视图合并
|
||||
can_be = parent_stmt->is_single_table_stmt()
|
||||
@ -1098,9 +1084,6 @@ int ObTransformViewMerge::adjust_updatable_view(ObDMLStmt *parent_stmt, TableIte
|
||||
} else if (OB_UNLIKELY(!table_item->is_generated_table())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unexpected table type", K(table_item->type_), K(ret));
|
||||
} else if (parent_stmt->is_update_stmt() &&
|
||||
OB_FAIL(static_cast<ObUpdateStmt*>(parent_stmt)->remove_invalid_assignment())) {
|
||||
LOG_WARN("failed to remove invalid assignment", K(ret));
|
||||
} else if (parent_stmt->is_delete_stmt() || parent_stmt->is_update_stmt()) {
|
||||
ObDelUpdStmt *del_upd_stmt = static_cast<ObDelUpdStmt *>(parent_stmt);
|
||||
ObSEArray<ObDmlTableInfo*, 2> table_infos;
|
||||
|
||||
Reference in New Issue
Block a user