[CP] [to #44746056] fix sql in pl readonly transaction check
This commit is contained in:
		| @ -4214,7 +4214,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() && !session->is_user_session()) || pc_ctx.is_begin_commit_stmt()) { | ||||
|       // FIXME: | ||||
|       // schema拆分后,为了避免建租户时获取不到租户read only属性导致建租户失败,对于inner sql | ||||
|       // 暂时跳过read only检查。实际上,对于tenant space系统表,不应该检查read only属性。 | ||||
|  | ||||
| @ -594,7 +594,7 @@ int ObPlanCache::get_plan(common::ObIAllocator &allocator, | ||||
|         if (GCONF.enable_perf_event) { | ||||
|           uint64_t tenant_id = pc_ctx.sql_ctx_.session_info_->get_effective_tenant_id(); | ||||
|           bool read_only = false; | ||||
|           if (pc_ctx.sql_ctx_.session_info_->is_inner()) { | ||||
|           if (pc_ctx.sql_ctx_.session_info_->is_inner() && !pc_ctx.sql_ctx_.session_info_->is_user_session()) { | ||||
|             // do nothing | ||||
|           } else if (OB_FAIL(pc_ctx.sql_ctx_.schema_guard_->get_tenant_read_only(tenant_id, | ||||
|                                                                                  read_only))) { | ||||
| @ -2266,7 +2266,7 @@ int ObPlanCache::get_ps_plan(ObCacheObjGuard& guard, | ||||
|   if (OB_SUCC(ret) && GCONF.enable_perf_event) { | ||||
|     uint64_t tenant_id = pc_ctx.sql_ctx_.session_info_->get_effective_tenant_id(); | ||||
|     bool read_only = false; | ||||
|     if (pc_ctx.sql_ctx_.session_info_->is_inner()) { | ||||
|     if (pc_ctx.sql_ctx_.session_info_->is_inner() && !pc_ctx.sql_ctx_.session_info_->is_user_session()) { | ||||
|       // do nothing | ||||
|     } else if (OB_FAIL(pc_ctx.sql_ctx_.schema_guard_->get_tenant_read_only(tenant_id, read_only))) { | ||||
|       SQL_PC_LOG(WARN, "fail to get tenant read only attribute", K(tenant_id), K(ret)); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 obdev
					obdev