partition_id_calc_type should reset after used

This commit is contained in:
yb0 2021-09-24 11:51:51 +08:00 committed by wangzelin.wzl
parent 73e3401749
commit ae8c941ed4
2 changed files with 14 additions and 0 deletions

View File

@ -178,6 +178,7 @@ int ObRepartSliceIdxCalc::get_partition_id(ObEvalCtx& eval_ctx, int64_t& partiti
{
int ret = OB_SUCCESS;
ObDatum* partition_id_datum = NULL;
CalcTypeGuard calc_type_guard(eval_ctx.exec_ctx_);
if (OB_REPARTITION_ONE_SIDE_ONE_LEVEL_FIRST == repart_type_) {
eval_ctx.exec_ctx_.set_partition_id_calc_type(CALC_IGNORE_SUB_PART);
} else if (OB_REPARTITION_ONE_SIDE_ONE_LEVEL_SUB == repart_type_) {

View File

@ -135,6 +135,19 @@ public:
typedef common::hash::ObHashMap<int64_t, int64_t, common::hash::NoPthreadDefendMode> PartId2ArrayIdxMap;
typedef common::hash::ObHashMap<int64_t, int64_t, common::hash::NoPthreadDefendMode> SubPartId2ArrayIdxMap;
class CalcTypeGuard {
public:
CalcTypeGuard(ObExecContext &exec_ctx) : exec_ctx_(exec_ctx)
{}
~CalcTypeGuard()
{
exec_ctx_.set_partition_id_calc_type(CALC_NORMAL);
}
private:
ObExecContext &exec_ctx_;
};
virtual ~ObRepartSliceIdxCalc()
{}
virtual int get_slice_idx(const common::ObNewRow& row, int64_t& slice_idx) override;