fix scn legacy issues

This commit is contained in:
obdev
2022-11-28 02:36:53 +00:00
committed by ob-robot
parent c4b4322d26
commit 4c49f6e7c5
118 changed files with 13655 additions and 2157 deletions

View File

@ -109,6 +109,7 @@ public:
conflict_checker_.destroy();
insert_up_rtdefs_.release_array();
insert_up_row_store_.~ObChunkDatumStore();
upd_rtctx_.cleanup();
ObTableModifyOp::destroy();
}

View File

@ -99,7 +99,6 @@ DEF_TO_STRING(ObEvalInfo)
OB_DEF_SERIALIZE(ObExpr)
{
int ret = OB_SUCCESS;
bool is_early_registered = ObExprExtraInfoFactory::is_early_registered(type_);
LST_DO_CODE(OB_UNIS_ENCODE,
type_,
datum_meta_,
@ -114,14 +113,8 @@ OB_DEF_SERIALIZE(ObExpr)
datum_off_,
res_buf_off_,
res_buf_len_,
expr_ctx_id_);
if (OB_SUCC(ret)) {
if (is_early_registered) {
OB_UNIS_ENCODE(*extra_info_);
} else {
OB_UNIS_ENCODE(extra_)
}
}
expr_ctx_id_,
extra_);
LST_DO_CODE(OB_UNIS_ENCODE,
eval_info_off_,
@ -132,7 +125,7 @@ OB_DEF_SERIALIZE(ObExpr)
if (OB_SUCC(ret)) {
ObExprOperatorType type = T_INVALID;
if (!is_early_registered && nullptr != extra_info_) {
if (nullptr != extra_info_) {
type = extra_info_->type_;
}
// Add a type before extra_info to determine whether extra_info is empty
@ -164,20 +157,8 @@ OB_DEF_DESERIALIZE(ObExpr)
datum_off_,
res_buf_off_,
res_buf_len_,
expr_ctx_id_);
if (OB_SUCC(ret)) {
if (ObExprExtraInfoFactory::is_early_registered(type_)) {
if (OB_FAIL(ObExprExtraInfoFactory::alloc(CURRENT_CONTEXT->get_arena_allocator(),
type_,
extra_info_))) {
LOG_WARN("fail to alloc expr extra info", K(ret), K(type_));
} else if (OB_NOT_NULL(extra_info_)) {
OB_UNIS_DECODE(*extra_info_);
}
} else {
OB_UNIS_DECODE(extra_);
}
}
expr_ctx_id_,
extra_);
LST_DO_CODE(OB_UNIS_DECODE,
eval_info_off_,
@ -202,6 +183,7 @@ OB_DEF_DESERIALIZE(ObExpr)
OB_UNIS_DECODE(*extra_info_);
}
}
if (OB_SUCC(ret)) {
basic_funcs_ = ObDatumFuncs::get_basic_func(datum_meta_.type_, datum_meta_.cs_type_);
CK(NULL != basic_funcs_);
@ -216,7 +198,6 @@ OB_DEF_DESERIALIZE(ObExpr)
OB_DEF_SERIALIZE_SIZE(ObExpr)
{
int64_t len = 0;
bool is_early_registered = ObExprExtraInfoFactory::is_early_registered(type_);
LST_DO_CODE(OB_UNIS_ADD_LEN,
type_,
datum_meta_,
@ -231,12 +212,8 @@ OB_DEF_SERIALIZE_SIZE(ObExpr)
datum_off_,
res_buf_off_,
res_buf_len_,
expr_ctx_id_);
if (is_early_registered) {
OB_UNIS_ADD_LEN(*extra_info_);
} else {
OB_UNIS_ADD_LEN(extra_);
}
expr_ctx_id_,
extra_);
LST_DO_CODE(OB_UNIS_ADD_LEN,
eval_info_off_,
@ -246,12 +223,11 @@ OB_DEF_SERIALIZE_SIZE(ObExpr)
pvt_skip_off_);
ObExprOperatorType type = T_INVALID;
if (!is_early_registered && nullptr != extra_info_) {
if (nullptr != extra_info_) {
type = extra_info_->type_;
}
// Add a type before extra_info to determine whether extra_info is empty
OB_UNIS_ADD_LEN(type);
if (!is_early_registered && nullptr != extra_info_) {
if (T_INVALID != type) {
OB_UNIS_ADD_LEN(*extra_info_);
}
OB_UNIS_ADD_LEN(dyn_buf_header_offset_);

View File

@ -41,26 +41,6 @@ public:
&& NULL != ALLOC_FUNS_[type];
}
// In the past, extra_ and extra_info_ were union structures in ObExpr. now move
// the extra_info_ in ObExpr from the union structure to the outer layer.
// therefore, in order to deal with upgrade compatibility issues, it is necessary to
// identify the type registered before moving extra_info_ to the outer layer.
// so, this function is used to determine whether the type is registered
// before moving extra_info_ to the outer layer of the union structure
// WARNING: It is forbidden to add new registration types to this function
inline static bool is_early_registered(const ObExprOperatorType &type)
{
return type == T_FUN_SYS_CALC_PARTITION_ID ||
type == T_FUN_SYS_CALC_TABLET_ID ||
type == T_FUN_SYS_CALC_PARTITION_TABLET_ID ||
type == T_FUN_ENUM_TO_STR ||
type == T_FUN_SET_TO_STR ||
type == T_FUN_ENUM_TO_INNER_TYPE ||
type == T_FUN_SET_TO_INNER_TYPE ||
type == T_FUN_COLUMN_CONV ||
type == T_FUN_NORMAL_UDF;
}
private:
template <typename T>
static int alloc(common::ObIAllocator &alloc, ObIExprExtraInfo *&extra_info,

View File

@ -104,7 +104,6 @@ ObPhysicalPlanCtx::ObPhysicalPlanCtx(common::ObIAllocator &allocator)
is_or_expand_transformed_(false),
is_show_seed_(false),
is_multi_dml_(false),
is_large_query_(false),
field_array_(nullptr),
is_ps_protocol_(false),
plan_start_time_(0),
@ -681,7 +680,6 @@ OB_DEF_SERIALIZE(ObPhysicalPlanCtx)
OB_UNIS_ENCODE(unsed_worker_count_since_222rel_);
OB_UNIS_ENCODE(tenant_schema_version_);
OB_UNIS_ENCODE(cursor_count);
OB_UNIS_ENCODE(is_large_query_);
OB_UNIS_ENCODE(plan_start_time_);
return ret;
}
@ -763,7 +761,6 @@ OB_DEF_SERIALIZE_SIZE(ObPhysicalPlanCtx)
OB_UNIS_ADD_LEN(unsed_worker_count_since_222rel_);
OB_UNIS_ADD_LEN(tenant_schema_version_);
OB_UNIS_ADD_LEN(cursor_count);
OB_UNIS_ADD_LEN(is_large_query_);
OB_UNIS_ADD_LEN(plan_start_time_);
return len;
}
@ -840,7 +837,6 @@ OB_DEF_DESERIALIZE(ObPhysicalPlanCtx)
LOG_WARN("init implicit cursor infos failed", K(ret));
}
}
OB_UNIS_DECODE(is_large_query_);
OB_UNIS_DECODE(plan_start_time_);
if (OB_SUCC(ret)) {
(void)ObSQLUtils::adjust_time_by_ntp_offset(plan_start_time_);

View File

@ -403,8 +403,6 @@ public:
int64_t get_cur_stmt_id() const { return cur_stmt_id_; }
int switch_implicit_cursor();
const ObIArray<int64_t> *get_part_param_idxs(int64_t part_id) const;
void set_large_query(bool v) { is_large_query_ = v; }
bool is_large_query() { return is_large_query_; }
void add_px_dml_row_info(const ObPxDmlRowInfo &dml_row_info);
TO_STRING_KV("tenant_id", tenant_id_);
void set_field_array(const common::ObIArray<common::ObField> *field_array) { field_array_ = field_array; }
@ -545,7 +543,6 @@ private:
bool is_multi_dml_;
ObRemoteSqlInfo remote_sql_info_;
bool is_large_query_; // 存储层使用该标记决定是否进行io限流
//used for expr output pack, do encode according to its field
const common::ObIArray<ObField> *field_array_;
//used for expr output pack, do bianry encode or text encode