提交 b2e66c1c 编写于 作者: R raywill 提交者: wangzelin.wzl

batch patch to opensource

上级 b276491a
...@@ -1809,7 +1809,16 @@ int ObSysVarOnCheckFuncs::check_and_convert_tx_isolation(ObExecContext& ctx, con ...@@ -1809,7 +1809,16 @@ int ObSysVarOnCheckFuncs::check_and_convert_tx_isolation(ObExecContext& ctx, con
LOG_USER_ERROR(OB_NOT_SUPPORTED, "Isolation level SERIALIZABLE not supported in system tenant"); LOG_USER_ERROR(OB_NOT_SUPPORTED, "Isolation level SERIALIZABLE not supported in system tenant");
LOG_WARN("Isolation level SERIALIZABLE not supported in system tenant", K(ret), K(in_val)); LOG_WARN("Isolation level SERIALIZABLE not supported in system tenant", K(ret), K(in_val));
} else { } else {
out_val = in_val; if (OB_FAIL(ob_write_obj(ctx.get_allocator(), in_val, out_val))) {
LOG_WARN("deep copy out_val obj failed", K(ret));
}
ObString tmp_out_val = out_val.get_string();
if (OB_FAIL(ob_simple_low_to_up(ctx.get_allocator(),
in_val.get_string(),
tmp_out_val))) {
LOG_WARN("Isolation level change to upper string failed", K(ret));
}
out_val.set_varchar(tmp_out_val);
} }
return ret; return ret;
} }
......
...@@ -4109,6 +4109,7 @@ int ObCodeGeneratorImpl::convert_pdml_delete(ObLogDelete& op, const PhyOpsDesc& ...@@ -4109,6 +4109,7 @@ int ObCodeGeneratorImpl::convert_pdml_delete(ObLogDelete& op, const PhyOpsDesc&
pdml_delete->get_dml_row_desc().set_part_id_index(partition_expr_idx); pdml_delete->get_dml_row_desc().set_part_id_index(partition_expr_idx);
} }
if (OB_SUCC(ret) && op.is_index_maintenance()) { if (OB_SUCC(ret) && op.is_index_maintenance()) {
// find shadow pk expr and add it to out row desc and calc_exprs
if (OB_FAIL(handle_pdml_shadow_pk(index_dml_info.column_exprs_, out_row_desc, out_row_desc, pdml_delete))) { if (OB_FAIL(handle_pdml_shadow_pk(index_dml_info.column_exprs_, out_row_desc, out_row_desc, pdml_delete))) {
LOG_WARN("failed to handle pdml shadow pk", K(ret), K(index_dml_info.column_exprs_)); LOG_WARN("failed to handle pdml shadow pk", K(ret), K(index_dml_info.column_exprs_));
} }
......
...@@ -162,7 +162,8 @@ ObExecContext::ObExecContext(ObIAllocator& allocator) ...@@ -162,7 +162,8 @@ ObExecContext::ObExecContext(ObIAllocator& allocator)
calc_type_(CALC_NORMAL), calc_type_(CALC_NORMAL),
fixed_id_(OB_INVALID_ID), fixed_id_(OB_INVALID_ID),
expr_partition_id_(OB_INVALID_ID), expr_partition_id_(OB_INVALID_ID),
iters_(256, allocator) iters_(256, allocator),
check_status_times_(0)
{} {}
ObExecContext::ObExecContext() ObExecContext::ObExecContext()
......
...@@ -229,7 +229,6 @@ int ObRepartSliceIdxCalc::get_previous_row_partition_id(ObObj& partition_id) ...@@ -229,7 +229,6 @@ int ObRepartSliceIdxCalc::get_previous_row_partition_id(ObObj& partition_id)
int ObSlaveMapRepartIdxCalcBase::init() int ObSlaveMapRepartIdxCalcBase::init()
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (OB_FAIL(ObRepartSliceIdxCalc::init())) { if (OB_FAIL(ObRepartSliceIdxCalc::init())) {
LOG_WARN("fail init base", K(ret)); LOG_WARN("fail init base", K(ret));
} }
...@@ -446,7 +445,6 @@ int ObRepartSliceIdxCalc::build_repart_ch_map(ObPxPartChMap& affinity_map) ...@@ -446,7 +445,6 @@ int ObRepartSliceIdxCalc::build_repart_ch_map(ObPxPartChMap& affinity_map)
LOG_WARN("fail create hashmap", "count", part_ch_array.count(), K(ret)); LOG_WARN("fail create hashmap", "count", part_ch_array.count(), K(ret));
} }
int64_t partition_id = common::OB_INVALID_INDEX_INT64; int64_t partition_id = common::OB_INVALID_INDEX_INT64;
ARRAY_FOREACH_X(part_ch_array, idx, cnt, OB_SUCC(ret)) ARRAY_FOREACH_X(part_ch_array, idx, cnt, OB_SUCC(ret))
{ {
......
...@@ -304,10 +304,6 @@ int ObOptimizer::check_pdml_supported_feature(const ObDMLStmt& stmt, const ObSQL ...@@ -304,10 +304,6 @@ int ObOptimizer::check_pdml_supported_feature(const ObDMLStmt& stmt, const ObSQL
} else if (table_schema->get_foreign_key_infos().count() > 0) { } else if (table_schema->get_foreign_key_infos().count() > 0) {
LOG_TRACE("dml has foreign key, disable pdml", K(ret)); LOG_TRACE("dml has foreign key, disable pdml", K(ret));
is_use_pdml = false; is_use_pdml = false;
} else if (stmt::T_DELETE == stmt.get_stmt_type()) {
// https://code.aone.alibaba-inc.com/oceanbase/oceanbase/codereview/5345309
// if no trigger, no foreign key, delete can do pdml, even if with local unique index
is_use_pdml = true;
} else if (!session.use_static_typing_engine() && stmt.get_check_constraint_exprs_size() > 0) { } else if (!session.use_static_typing_engine() && stmt.get_check_constraint_exprs_size() > 0) {
LOG_TRACE("dml has constraint, old engine, disable pdml", K(ret)); LOG_TRACE("dml has constraint, old engine, disable pdml", K(ret));
is_use_pdml = false; is_use_pdml = false;
......
...@@ -182,10 +182,22 @@ int ObPxResourceAnalyzer::analyze(ObLogicalOperator& root_op, int64_t& max_paral ...@@ -182,10 +182,22 @@ int ObPxResourceAnalyzer::analyze(ObLogicalOperator& root_op, int64_t& max_paral
LOG_WARN("fail convert log plan to nested px tree", K(ret)); LOG_WARN("fail convert log plan to nested px tree", K(ret));
} else if (OB_FAIL(walk_through_px_trees(px_trees, max_parallel_thread_group_count))) { } else if (OB_FAIL(walk_through_px_trees(px_trees, max_parallel_thread_group_count))) {
LOG_WARN("fail calc max parallel thread group count for resource reservation", K(ret)); LOG_WARN("fail calc max parallel thread group count for resource reservation", K(ret));
} else {
release();
} }
return ret; return ret;
} }
void ObPxResourceAnalyzer::release()
{
for (int64_t i = 0; i < dfos_.count(); ++i) {
DfoInfo* dfo = dfos_.at(i);
if (OB_LIKELY(nullptr != dfo)) {
dfo->~DfoInfo();
}
}
}
int ObPxResourceAnalyzer::convert_log_plan_to_nested_px_tree(ObIArray<PxInfo>& px_trees, ObLogicalOperator& root_op) int ObPxResourceAnalyzer::convert_log_plan_to_nested_px_tree(ObIArray<PxInfo>& px_trees, ObLogicalOperator& root_op)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
...@@ -296,6 +308,8 @@ int ObPxResourceAnalyzer::create_dfo(DfoInfo*& dfo, int64_t dop) ...@@ -296,6 +308,8 @@ int ObPxResourceAnalyzer::create_dfo(DfoInfo*& dfo, int64_t dop)
} else if (nullptr == (dfo = new (mem_ptr) DfoInfo())) { } else if (nullptr == (dfo = new (mem_ptr) DfoInfo())) {
ret = OB_ERR_UNEXPECTED; ret = OB_ERR_UNEXPECTED;
LOG_WARN("Null ptr unexpected", KP(mem_ptr), K(ret)); LOG_WARN("Null ptr unexpected", KP(mem_ptr), K(ret));
} else if (OB_FAIL(dfos_.push_back(dfo))) {
LOG_WARN("fail push dfo. no memory!", K(ret));
} else { } else {
dfo->set_dop(dop); dfo->set_dop(dop);
} }
......
...@@ -139,10 +139,12 @@ private: ...@@ -139,10 +139,12 @@ private:
int walk_through_px_trees(common::ObIArray<PxInfo>& px_trees, int64_t& max_parallel_thread_group_count); int walk_through_px_trees(common::ObIArray<PxInfo>& px_trees, int64_t& max_parallel_thread_group_count);
int walk_through_dfo_tree(PxInfo& px_root, int64_t& max_parallel_thread_group_count); int walk_through_dfo_tree(PxInfo& px_root, int64_t& max_parallel_thread_group_count);
int create_dfo(DfoInfo*& dfo, int64_t dop); int create_dfo(DfoInfo*& dfo, int64_t dop);
void release();
private: private:
/* variables */ /* variables */
common::ObArenaAllocator dfo_allocator_; common::ObArenaAllocator dfo_allocator_;
common::ObArray<DfoInfo*> dfos_;
DISALLOW_COPY_AND_ASSIGN(ObPxResourceAnalyzer); DISALLOW_COPY_AND_ASSIGN(ObPxResourceAnalyzer);
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册