diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index 8f6d02b00d1f43d933425c1e6969015a342d8c87..b77ac05a0c2551a8bb021e6cd1653b0f8dcb1775 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -3671,6 +3671,10 @@ const uint64_t tenant_space_tables [] = { OB_TENANT_PARAMETER_TID, OB_ALL_SYS_VARIABLE_TID, OB_ALL_SYS_STAT_TID, + OB_HELP_TOPIC_TID, + OB_HELP_CATEGORY_TID, + OB_HELP_KEYWORD_TID, + OB_HELP_RELATION_TID, OB_ALL_DUMMY_TID, OB_ALL_OUTLINE_TID, OB_ALL_OUTLINE_HISTORY_TID, @@ -4833,6 +4837,10 @@ const uint64_t tenant_space_tables [] = { OB_TENANT_PARAMETER_AUX_LOB_META_TID, OB_ALL_SYS_VARIABLE_AUX_LOB_META_TID, OB_ALL_SYS_STAT_AUX_LOB_META_TID, + OB_HELP_TOPIC_AUX_LOB_META_TID, + OB_HELP_CATEGORY_AUX_LOB_META_TID, + OB_HELP_KEYWORD_AUX_LOB_META_TID, + OB_HELP_RELATION_AUX_LOB_META_TID, OB_ALL_DUMMY_AUX_LOB_META_TID, OB_ALL_OUTLINE_AUX_LOB_META_TID, OB_ALL_OUTLINE_HISTORY_AUX_LOB_META_TID, @@ -5025,6 +5033,10 @@ const uint64_t tenant_space_tables [] = { OB_TENANT_PARAMETER_AUX_LOB_PIECE_TID, OB_ALL_SYS_VARIABLE_AUX_LOB_PIECE_TID, OB_ALL_SYS_STAT_AUX_LOB_PIECE_TID, + OB_HELP_TOPIC_AUX_LOB_PIECE_TID, + OB_HELP_CATEGORY_AUX_LOB_PIECE_TID, + OB_HELP_KEYWORD_AUX_LOB_PIECE_TID, + OB_HELP_RELATION_AUX_LOB_PIECE_TID, OB_ALL_DUMMY_AUX_LOB_PIECE_TID, OB_ALL_OUTLINE_AUX_LOB_PIECE_TID, OB_ALL_OUTLINE_HISTORY_AUX_LOB_PIECE_TID, @@ -5445,6 +5457,10 @@ const char* const tenant_space_table_names [] = { OB_TENANT_PARAMETER_TNAME, OB_ALL_SYS_VARIABLE_TNAME, OB_ALL_SYS_STAT_TNAME, + OB_HELP_TOPIC_TNAME, + OB_HELP_CATEGORY_TNAME, + OB_HELP_KEYWORD_TNAME, + OB_HELP_RELATION_TNAME, OB_ALL_DUMMY_TNAME, OB_ALL_OUTLINE_TNAME, OB_ALL_OUTLINE_HISTORY_TNAME, @@ -6607,6 +6623,10 @@ const char* const tenant_space_table_names [] = { OB_TENANT_PARAMETER_AUX_LOB_META_TNAME, OB_ALL_SYS_VARIABLE_AUX_LOB_META_TNAME, OB_ALL_SYS_STAT_AUX_LOB_META_TNAME, + OB_HELP_TOPIC_AUX_LOB_META_TNAME, + OB_HELP_CATEGORY_AUX_LOB_META_TNAME, + OB_HELP_KEYWORD_AUX_LOB_META_TNAME, + OB_HELP_RELATION_AUX_LOB_META_TNAME, OB_ALL_DUMMY_AUX_LOB_META_TNAME, OB_ALL_OUTLINE_AUX_LOB_META_TNAME, OB_ALL_OUTLINE_HISTORY_AUX_LOB_META_TNAME, @@ -6799,6 +6819,10 @@ const char* const tenant_space_table_names [] = { OB_TENANT_PARAMETER_AUX_LOB_PIECE_TNAME, OB_ALL_SYS_VARIABLE_AUX_LOB_PIECE_TNAME, OB_ALL_SYS_STAT_AUX_LOB_PIECE_TNAME, + OB_HELP_TOPIC_AUX_LOB_PIECE_TNAME, + OB_HELP_CATEGORY_AUX_LOB_PIECE_TNAME, + OB_HELP_KEYWORD_AUX_LOB_PIECE_TNAME, + OB_HELP_RELATION_AUX_LOB_PIECE_TNAME, OB_ALL_DUMMY_AUX_LOB_PIECE_TNAME, OB_ALL_OUTLINE_AUX_LOB_PIECE_TNAME, OB_ALL_OUTLINE_HISTORY_AUX_LOB_PIECE_TNAME, diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index d298820802c828e73f1d6ef06421165f617ebd87..1ec0e1c6047ee8a5f3ebc03e0183d8270c975c29 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -813,7 +813,7 @@ def_table_schema( rowkey_columns = [ ('help_topic_id', 'int','false'), ], - in_tenant_space = False, + in_tenant_space = True, normal_columns = [ ('name', 'varchar:64','false'), @@ -834,7 +834,7 @@ def_table_schema( rowkey_columns = [ ('help_category_id', 'int','false'), ], - in_tenant_space = False, + in_tenant_space = True, normal_columns = [ ('name', 'varchar:64','false'), @@ -853,7 +853,7 @@ def_table_schema( rowkey_columns = [ ('help_keyword_id', 'int','false'), ], - in_tenant_space = False, + in_tenant_space = True, normal_columns = [ ('name', 'varchar:64','false'), @@ -871,7 +871,7 @@ def_table_schema( ('help_topic_id', 'int','false'), ('help_keyword_id', 'int','false'), ], - in_tenant_space = False, + in_tenant_space = True, normal_columns = [], ) diff --git a/src/share/schema/ob_schema_struct.cpp b/src/share/schema/ob_schema_struct.cpp index 9286cf4b45110b1b34b5058c347a1afda0ed974c..32086b24536e7bc716f5773523b3d0a6961bc5e3 100644 --- a/src/share/schema/ob_schema_struct.cpp +++ b/src/share/schema/ob_schema_struct.cpp @@ -303,15 +303,6 @@ int ObSysTableChecker::check_sys_table_name( LOG_WARN("table_name is empty", K(ret)); } else if (!is_sys_database_id(database_id)) { is_system_table = false; - } else if (is_mysql_database_id(database_id) - && !is_sys_tenant(tenant_id) - && (0 == table_name.case_compare(OB_HELP_TOPIC_TNAME) - || 0 == table_name.case_compare(OB_HELP_CATEGORY_TNAME) - || 0 == table_name.case_compare(OB_HELP_KEYWORD_TNAME) - || 0 == table_name.case_compare(OB_HELP_RELATION_TNAME))) { - // FIXME:(yanmu.ztl) Actually, we should build sys_table_name_map_ with `in_tenant_space` flag. - // bugfix: https://work.aone.alibaba-inc.com/issue/35660182 - is_system_table = false; } else { ObNameCaseMode mode = OB_ORIGIN_AND_INSENSITIVE; const TableNameWrapper table(database_id, mode, table_name); diff --git a/src/sql/engine/expr/ob_expr.cpp b/src/sql/engine/expr/ob_expr.cpp index 46f2bf8e6bc2de91a0130b013d18a7d8c0ef1fc2..e6f6d075606070b7b3750a14b880a748653d3860 100644 --- a/src/sql/engine/expr/ob_expr.cpp +++ b/src/sql/engine/expr/ob_expr.cpp @@ -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_); diff --git a/src/sql/engine/expr/ob_expr_extra_info_factory.h b/src/sql/engine/expr/ob_expr_extra_info_factory.h index 31528c5d31721ab827b0f713b8a10026320359c6..7da9df70ec2a63eb587276d65ec2ad31d7bb5889 100644 --- a/src/sql/engine/expr/ob_expr_extra_info_factory.h +++ b/src/sql/engine/expr/ob_expr_extra_info_factory.h @@ -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 static int alloc(common::ObIAllocator &alloc, ObIExprExtraInfo *&extra_info, diff --git a/src/sql/engine/ob_physical_plan_ctx.cpp b/src/sql/engine/ob_physical_plan_ctx.cpp index 14da30940fc32e5d33120f7c40188c5425e0338f..8a71724b7976d9535d83af3e1fd2a23142044a3b 100644 --- a/src/sql/engine/ob_physical_plan_ctx.cpp +++ b/src/sql/engine/ob_physical_plan_ctx.cpp @@ -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_); diff --git a/src/sql/engine/ob_physical_plan_ctx.h b/src/sql/engine/ob_physical_plan_ctx.h index 84833e82831fa4bdaecfd0e0721dfac48aeb13a2..09d0342b431e519974022efa201df14de23e64d9 100644 --- a/src/sql/engine/ob_physical_plan_ctx.h +++ b/src/sql/engine/ob_physical_plan_ctx.h @@ -403,8 +403,6 @@ public: int64_t get_cur_stmt_id() const { return cur_stmt_id_; } int switch_implicit_cursor(); const ObIArray *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 *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 *field_array_; //used for expr output pack, do bianry encode or text encode diff --git a/src/sql/ob_sql.cpp b/src/sql/ob_sql.cpp index f333d8489e42976ab302518fb44f3da7a3ad7ff9..01f4fe004c67e5d86922b99084fb795037a0ae15 100644 --- a/src/sql/ob_sql.cpp +++ b/src/sql/ob_sql.cpp @@ -1992,14 +1992,6 @@ OB_NOINLINE int ObSql::handle_large_query(int tmp_ret, LOG_INFO("compile time is too long, need delay", K(elapsed_time), K(ret)); } } - if (OB_SUCC(ret)) { - if (OB_ISNULL(exec_ctx.get_physical_plan_ctx())) { - ret = OB_ERR_UNEXPECTED; - LOG_WARN("phy plan ctx is NULL", K(ret)); - } else { - exec_ctx.get_physical_plan_ctx()->set_large_query(is_large_query); - } - } } return ret;