[to #45179793]inner table update do not use codegen_lock_
This commit is contained in:
@ -2020,6 +2020,7 @@ int ObPL::get_pl_function(ObExecContext &ctx,
|
||||
LOG_DEBUG("get pl function from plan cache success", KPC(routine));
|
||||
}
|
||||
if (OB_SUCC(ret) && OB_ISNULL(routine)) { // not in cache, compile it...
|
||||
bool need_update_schema = false;
|
||||
{
|
||||
ObBucketHashWLockGuard guard(codegen_lock_, routine_id);
|
||||
// check again after get lock.
|
||||
@ -2038,6 +2039,7 @@ int ObPL::get_pl_function(ObExecContext &ctx,
|
||||
&& routine->get_can_cached()) {
|
||||
OZ (add_pl_lib_cache(routine, pc_ctx));
|
||||
}
|
||||
OX (need_update_schema = true);
|
||||
LOG_DEBUG("get func by compile",
|
||||
K(package_id), K(routine_id), KPC(routine));
|
||||
}
|
||||
@ -2049,6 +2051,14 @@ int ObPL::get_pl_function(ObExecContext &ctx,
|
||||
OZ (ctx.get_sql_ctx()->schema_guard_->get_routine_info(tenant_id, routine_id, routine_info));
|
||||
CK (OB_NOT_NULL(routine_info));
|
||||
OZ (error_info.delete_error(routine_info));
|
||||
if (need_update_schema) {
|
||||
OZ (ObPLCompiler::update_schema_object_dep_info(routine->get_dependency_table(),
|
||||
routine->get_tenant_id(),
|
||||
routine->get_owner(),
|
||||
routine_id,
|
||||
routine_info->get_schema_version(),
|
||||
routine_info->get_object_type()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -429,23 +429,18 @@ int ObPLCompiler::compile(const uint64_t id, ObPLFunction &func)
|
||||
session_info_.set_database_id(old_db_id);
|
||||
}
|
||||
}
|
||||
|
||||
OZ (update_schema_object_dep_info(func_ast,
|
||||
proc->get_tenant_id(),
|
||||
proc->get_routine_id(),
|
||||
proc->get_schema_version(),
|
||||
proc->get_owner_id(),
|
||||
proc->get_object_type()));
|
||||
int64_t final_end = ObTimeUtility::current_time();
|
||||
LOG_INFO(">>>>>>>>Final Time: ", K(id), K(final_end - cg_end));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObPLCompiler::update_schema_object_dep_info(ObPLCompileUnitAST &ast,
|
||||
int ObPLCompiler::update_schema_object_dep_info(ObIArray<ObSchemaObjVersion> &dp_tbl,
|
||||
uint64_t tenant_id,
|
||||
uint64_t dep_obj_id, uint64_t schema_version,
|
||||
uint64_t owner_id, ObObjectType dep_obj_type)
|
||||
uint64_t owner_id,
|
||||
uint64_t dep_obj_id,
|
||||
uint64_t schema_version,
|
||||
ObObjectType dep_obj_type)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObMySQLProxy *sql_proxy = nullptr;
|
||||
@ -473,7 +468,7 @@ int ObPLCompiler::update_schema_object_dep_info(ObPLCompileUnitAST &ast,
|
||||
dep_obj_type));
|
||||
ObSArray<ObDependencyInfo> dep_infos;
|
||||
ObString dummy;
|
||||
OZ (ObDependencyInfo::collect_dep_infos(ast.get_dependency_table(),
|
||||
OZ (ObDependencyInfo::collect_dep_infos(dp_tbl,
|
||||
dep_infos,
|
||||
dep_obj_type,
|
||||
0, dummy, dummy));
|
||||
@ -717,11 +712,11 @@ int ObPLCompiler::compile_package(const ObPackageInfo &package_info,
|
||||
OX (package.set_can_cached(package_ast.get_can_cached()));
|
||||
OX (package_ast.get_serially_reusable() ? package.set_serially_reusable() : void(NULL));
|
||||
session_info_.set_for_trigger_package(saved_trigger_flag);
|
||||
OZ (update_schema_object_dep_info(package_ast,
|
||||
OZ (update_schema_object_dep_info(package_ast.get_dependency_table(),
|
||||
package_info.get_tenant_id(),
|
||||
package_info.get_owner_id(),
|
||||
package_info.get_package_id(),
|
||||
package_info.get_schema_version(),
|
||||
package_info.get_owner_id(),
|
||||
package_info.get_object_type()));
|
||||
if (OB_SUCC(ret)) {
|
||||
ObErrorInfo error_info;
|
||||
|
@ -78,10 +78,11 @@ public:
|
||||
bool is_prepare_protocol = true);
|
||||
int check_package_body_legal(const ObPLBlockNS *parent_ns,
|
||||
const ObPLPackageAST &package_ast);
|
||||
static int update_schema_object_dep_info(pl::ObPLCompileUnitAST &ast,
|
||||
static int update_schema_object_dep_info(ObIArray<ObSchemaObjVersion> &dp_tbl,
|
||||
uint64_t tenant_id,
|
||||
uint64_t dep_obj_id, uint64_t schema_version,
|
||||
uint64_t owner_id,
|
||||
uint64_t dep_obj_id,
|
||||
uint64_t schema_version,
|
||||
share::schema::ObObjectType dep_obj_type);
|
||||
private:
|
||||
int init_function(const share::schema::ObRoutineInfo *proc, ObPLFunction &func);
|
||||
|
@ -1133,11 +1133,11 @@ int ObTriggerResolver::analyze_trigger(ObSchemaGetterGuard &schema_guard,
|
||||
}
|
||||
if (OB_SUCC(ret) && lib::is_oracle_mode()) {
|
||||
if (is_alter_compile) {
|
||||
OZ (ObPLCompiler::update_schema_object_dep_info(package_body_ast,
|
||||
OZ (ObPLCompiler::update_schema_object_dep_info(package_body_ast.get_dependency_table(),
|
||||
trigger_info.get_tenant_id(),
|
||||
trigger_info.get_owner_id(),
|
||||
trigger_info.get_trigger_id(),
|
||||
trigger_info.get_schema_version(),
|
||||
trigger_info.get_owner_id(),
|
||||
trigger_info.get_object_type()));
|
||||
} else {
|
||||
ObString dep_attr;
|
||||
|
Reference in New Issue
Block a user