fix for partid result wrong when mixed execution with 434
This commit is contained in:
parent
1599572972
commit
bfc10616a3
@ -1505,5 +1505,25 @@ int ObExprCalcPartitionBase::set_first_part_id(ObExecContext &ctx, const ObExpr
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExprCalcPartitionBase::update_part_id_calc_type_for_upgrade(
|
||||
ObExecContext &ctx,
|
||||
const ObExpr &expr,
|
||||
PartitionIdCalcType calc_type)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
uint64_t expr_ctx_id = static_cast<uint64_t>(expr.expr_ctx_id_);
|
||||
if (ObExpr::INVALID_EXP_CTX_ID == expr_ctx_id) {
|
||||
// 混跑要动态改partition_id_calc_type,434以下不会设置这个expr_ctx_id_
|
||||
CalcPartitionBaseInfo *calc_part_info = reinterpret_cast<CalcPartitionBaseInfo *>(expr.extra_info_);
|
||||
if (OB_ISNULL(calc_part_info)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("extra info is null", K(ret));
|
||||
} else {
|
||||
calc_part_info->partition_id_calc_type_ = calc_type;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -223,6 +223,8 @@ public:
|
||||
virtual bool need_rt_ctx() const override { return true; }
|
||||
static int get_first_part_id(ObExecContext &ctx, const ObExpr &expr, int64_t &first_part_id);
|
||||
static int set_first_part_id(ObExecContext &ctx, const ObExpr &expr, const int64_t first_part_id);
|
||||
static int update_part_id_calc_type_for_upgrade(ObExecContext &ctx, const ObExpr &expr,
|
||||
PartitionIdCalcType calc_type);
|
||||
private:
|
||||
int init_calc_part_info(common::ObIAllocator *allocator,
|
||||
const share::schema::ObTableSchema &table_schema,
|
||||
|
@ -774,12 +774,20 @@ int ObRepartSliceIdxCalc::setup_one_side_one_level_info()
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected calc part id expr", K(ret));
|
||||
} else if (OB_REPARTITION_ONE_SIDE_ONE_LEVEL_FIRST == repart_type_) {
|
||||
if (OB_FAIL(build_part2tablet_id_map())) {
|
||||
if (OB_FAIL(ObExprCalcPartitionBase::
|
||||
update_part_id_calc_type_for_upgrade(exec_ctx_, *calc_part_id_expr_,
|
||||
CALC_IGNORE_SUB_PART))) {
|
||||
LOG_WARN("update calc type for mixed run failed", K(ret));
|
||||
} else if (OB_FAIL(build_part2tablet_id_map())) {
|
||||
LOG_WARN("fail to build part2tablet id map", K(ret));
|
||||
}
|
||||
} else if (OB_REPARTITION_ONE_SIDE_ONE_LEVEL_SUB == repart_type_) {
|
||||
int64_t first_part_id = OB_INVALID_ID;
|
||||
if (OB_FAIL(get_part_id_by_one_level_sub_ch_map(first_part_id))) {
|
||||
if (OB_FAIL(ObExprCalcPartitionBase::
|
||||
update_part_id_calc_type_for_upgrade(exec_ctx_, *calc_part_id_expr_,
|
||||
CALC_IGNORE_FIRST_PART))) {
|
||||
LOG_WARN("update calc type for mixed run failed", K(ret));
|
||||
} else if (OB_FAIL(get_part_id_by_one_level_sub_ch_map(first_part_id))) {
|
||||
LOG_WARN("fail to get part id by ch map", K(ret));
|
||||
} else if (OB_FAIL(ObExprCalcPartitionBase::set_first_part_id(exec_ctx_, *calc_part_id_expr_,
|
||||
first_part_id))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user