fix insert partition wise plan bug

This commit is contained in:
zzg19950727
2024-03-06 04:44:58 +00:00
committed by ob-robot
parent 7b3bee5a2e
commit 8474eace9f
3 changed files with 8 additions and 4 deletions

View File

@ -566,7 +566,8 @@ int ObInsertLogPlan::create_insert_plans(ObIArray<CandidatePlan> &candi_plans,
lock_row_flag_expr,
insert_table_part,
insert_op_sharding,
is_multi_part_dml))) {
is_multi_part_dml,
DIST_PARTITION_WISE == distributed_methods))) {
LOG_WARN("failed to allocate insert as top", K(ret));
} else if (OB_FAIL(insert_plans.push_back(candi_plan))) {
LOG_WARN("failed to push back", K(ret));
@ -579,7 +580,8 @@ int ObInsertLogPlan::allocate_insert_as_top(ObLogicalOperator *&top,
ObRawExpr *lock_row_flag_expr,
ObTablePartitionInfo *table_partition_info,
ObShardingInfo *insert_op_sharding,
bool is_multi_part_dml)
bool is_multi_part_dml,
bool is_partition_wise)
{
int ret = OB_SUCCESS;
ObLogInsert *insert_op = NULL;
@ -608,6 +610,7 @@ int ObInsertLogPlan::allocate_insert_as_top(ObLogicalOperator *&top,
insert_op->set_table_partition_info(table_partition_info);
insert_op->set_lock_row_flag_expr(lock_row_flag_expr);
insert_op->set_has_instead_of_trigger(insert_stmt->has_instead_of_trigger());
insert_op->set_is_partition_wise(is_partition_wise);
if (OB_NOT_NULL(insert_stmt->get_table_item(0))) {
insert_op->set_append_table_id(insert_stmt->get_table_item(0)->ref_id_);
}

View File

@ -66,7 +66,8 @@ protected:
ObRawExpr *lock_row_flag_expr,
ObTablePartitionInfo *table_partition_info,
ObShardingInfo *insert_op_sharding,
bool is_multi_part);
bool is_multi_part,
bool is_partition_wise);
int candi_allocate_pdml_insert(OSGShareInfo *osg_info);
int candi_allocate_optimizer_stats_merge(OSGShareInfo *osg_info);

View File

@ -188,7 +188,7 @@ int ObLogInsert::compute_sharding_info()
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(ret));
} else if (NULL != get_sharding()) {
is_partition_wise_ = true;
//do nothing
} else if (is_multi_part_dml()) {
strong_sharding_ = get_plan()->get_optimizer_context().get_local_sharding();
} else if (OB_FAIL(ObLogDelUpd::compute_sharding_info())) {