[CP] The internal SQL of udf cannot hit the plan cache

This commit is contained in:
obdev
2023-11-01 07:10:00 +00:00
committed by ob-robot
parent daa3e2416d
commit 6ecc0292a5
3 changed files with 13 additions and 7 deletions

View File

@ -1511,6 +1511,7 @@ int ObSql::handle_pl_execute(const ObString &sql,
LOG_WARN("failed to init result set", K(ret));
} else {
context.cur_sql_ = sql;
context.is_from_pl_ = true;
context.is_dynamic_sql_ = is_dynamic_sql;
context.is_prepare_protocol_ = is_prepare_protocol;
context.spm_ctx_.bl_key_.db_id_ = session.get_database_id();
@ -4173,7 +4174,7 @@ int ObSql::parser_and_check(const ObString &outlined_stmt,
if (OB_SUCC(ret)) {
//租户级别的read only检查
if (session->is_inner() || pc_ctx.is_begin_commit_stmt()) {
if ((session->is_inner() && !pc_ctx.sql_ctx_.is_from_pl_) || pc_ctx.is_begin_commit_stmt()) {
// FIXME:
// schema拆分后,为了避免建租户时获取不到租户read only属性导致建租户失败,对于inner sql
// 暂时跳过read only检查。实际上,对于tenant space系统表,不应该检查read only属性。