diff --git a/src/observer/mysql/obmp_query.cpp b/src/observer/mysql/obmp_query.cpp index 3bee30aef3..f90d54faf8 100644 --- a/src/observer/mysql/obmp_query.cpp +++ b/src/observer/mysql/obmp_query.cpp @@ -615,6 +615,7 @@ OB_NOINLINE int ObMPQuery::process_with_tmp_context(ObSQLSessionInfo &session, force_sync_resp, async_resp_used, need_disconnect); + ctx_.first_plan_hash_ = 0; ctx_.first_outline_data_.reset(); ctx_.clear(); } diff --git a/src/sql/rewrite/ob_transform_join_elimination.cpp b/src/sql/rewrite/ob_transform_join_elimination.cpp index d716feb4b9..e35a38eb03 100644 --- a/src/sql/rewrite/ob_transform_join_elimination.cpp +++ b/src/sql/rewrite/ob_transform_join_elimination.cpp @@ -1703,8 +1703,6 @@ int ObTransformJoinElimination::eliminate_semi_join_self_foreign_key(ObDMLStmt * if (OB_ISNULL(semi_info = semi_infos.at(i))) { ret = OB_ERR_UNEXPECTED; LOG_WARN("get unexpected null", K(ret), K(semi_info)); - } else if (OB_FAIL(preprocess_generate_right_table(*stmt, *semi_info))) { - LOG_WARN("failed to preprocess generate right table", K(ret)); } else if (OB_FAIL(eliminate_semi_join_self_key(stmt, semi_info, candi_conds, @@ -1734,23 +1732,6 @@ int ObTransformJoinElimination::eliminate_semi_join_self_foreign_key(ObDMLStmt * return ret; } -// flatten joined table in right table -int ObTransformJoinElimination::preprocess_generate_right_table(ObDMLStmt &stmt, - SemiInfo &semi_info) -{ - int ret = OB_SUCCESS; - TableItem *right_table = NULL; - if (OB_ISNULL(right_table = stmt.get_table_item_by_id(semi_info.right_table_id_))) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("get unexpected null", K(right_table), K(ret)); - } else if (!right_table->is_generated_table()) { - /* do nothing */ - } else if (OB_FAIL(ObTransformUtils::flatten_joined_table(right_table->ref_query_))) { - LOG_WARN("failed to faltten joined table", K(ret)); - } - return ret; -} - int ObTransformJoinElimination::eliminate_semi_join_self_key(ObDMLStmt *stmt, SemiInfo *semi_info, ObIArray &conds, diff --git a/src/sql/rewrite/ob_transform_join_elimination.h b/src/sql/rewrite/ob_transform_join_elimination.h index b1a11fe662..b277b5bc49 100644 --- a/src/sql/rewrite/ob_transform_join_elimination.h +++ b/src/sql/rewrite/ob_transform_join_elimination.h @@ -431,8 +431,6 @@ private: int left_join_can_be_eliminated(ObDMLStmt *stmt, TableItem *table, bool &can_be_eliminated); - int preprocess_generate_right_table(ObDMLStmt &stmt, SemiInfo &semi_info); - int eliminate_semi_join_self_key(ObDMLStmt *stmt, SemiInfo *semi_info, ObIArray &conds, diff --git a/src/sql/rewrite/ob_transform_predicate_move_around.cpp b/src/sql/rewrite/ob_transform_predicate_move_around.cpp index 93221c5a80..ebcbc7b1a8 100644 --- a/src/sql/rewrite/ob_transform_predicate_move_around.cpp +++ b/src/sql/rewrite/ob_transform_predicate_move_around.cpp @@ -1565,7 +1565,8 @@ int ObTransformPredicateMoveAround::pushdown_into_set_stmt(ObSelectStmt *stmt, LOG_WARN("assign preds failed", K(ret)); } else if (OB_FAIL(append(pushdown_preds, invalid_pushdown_preds))) { LOG_WARN("failed to append no push down preds", K(ret)); - } else if (pushdown_preds.count() != pushdown_preds_cnt + } else if ((pushdown_preds.count() != pushdown_preds_cnt + || (stmt->is_set_stmt() && ObOptimizerUtil::find_item(transed_stmts_, stmt))) && OB_FAIL(add_var_to_array_no_dup(transed_stmts_, static_cast(parent_stmt)))) { LOG_WARN("append transed stmt failed", K(ret)); } else {/*do nothing*/}