Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
9710bb14
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9710bb14
编写于
2月 07, 2022
作者:
L
lf0
提交者:
LINGuanRen
2月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix core at plan cache ObCacheObject::pre_calculation
上级
f51dd07d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
0 deletion
+12
-0
src/sql/engine/ob_physical_plan_ctx.cpp
src/sql/engine/ob_physical_plan_ctx.cpp
+7
-0
src/sql/engine/ob_physical_plan_ctx.h
src/sql/engine/ob_physical_plan_ctx.h
+1
-0
src/sql/plan_cache/ob_plan_cache.cpp
src/sql/plan_cache/ob_plan_cache.cpp
+4
-0
未找到文件。
src/sql/engine/ob_physical_plan_ctx.cpp
浏览文件 @
9710bb14
...
@@ -86,6 +86,13 @@ ObPhysicalPlanCtx::ObPhysicalPlanCtx(common::ObIAllocator& allocator)
...
@@ -86,6 +86,13 @@ ObPhysicalPlanCtx::ObPhysicalPlanCtx(common::ObIAllocator& allocator)
ObPhysicalPlanCtx
::~
ObPhysicalPlanCtx
()
ObPhysicalPlanCtx
::~
ObPhysicalPlanCtx
()
{}
{}
void
ObPhysicalPlanCtx
::
restore_param_store
(
const
int64_t
original_param_cnt
)
{
for
(
int64_t
i
=
param_store_
.
count
();
i
>
original_param_cnt
;
--
i
)
{
param_store_
.
pop_back
();
}
}
int
ObPhysicalPlanCtx
::
reserve_param_space
(
int64_t
param_count
)
int
ObPhysicalPlanCtx
::
reserve_param_space
(
int64_t
param_count
)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
...
...
src/sql/engine/ob_physical_plan_ctx.h
浏览文件 @
9710bb14
...
@@ -135,6 +135,7 @@ public:
...
@@ -135,6 +135,7 @@ public:
{
{
return
consistency_level_
;
return
consistency_level_
;
}
}
void
restore_param_store
(
const
int64_t
param_count
);
// param store
// param store
int
reserve_param_space
(
int64_t
param_count
);
int
reserve_param_space
(
int64_t
param_count
);
const
ParamStore
&
get_param_store
()
const
const
ParamStore
&
get_param_store
()
const
...
...
src/sql/plan_cache/ob_plan_cache.cpp
浏览文件 @
9710bb14
...
@@ -1496,6 +1496,7 @@ int ObPlanCache::get_ps_plan(
...
@@ -1496,6 +1496,7 @@ int ObPlanCache::get_ps_plan(
UNUSED
(
stmt_id
);
UNUSED
(
stmt_id
);
ObSqlTraits
sql_traits
;
ObSqlTraits
sql_traits
;
ObCacheObject
*
cache_obj
=
NULL
;
ObCacheObject
*
cache_obj
=
NULL
;
int64_t
original_param_cnt
=
0
;
pc_ctx
.
handle_id_
=
ref_handle
;
pc_ctx
.
handle_id_
=
ref_handle
;
if
(
OB_ISNULL
(
pc_ctx
.
sql_ctx_
.
session_info_
)
||
OB_ISNULL
(
pc_ctx
.
sql_ctx_
.
schema_guard_
)
||
if
(
OB_ISNULL
(
pc_ctx
.
sql_ctx_
.
session_info_
)
||
OB_ISNULL
(
pc_ctx
.
sql_ctx_
.
schema_guard_
)
||
OB_ISNULL
(
pc_ctx
.
exec_ctx_
.
get_physical_plan_ctx
()))
{
OB_ISNULL
(
pc_ctx
.
exec_ctx_
.
get_physical_plan_ctx
()))
{
...
@@ -1509,6 +1510,8 @@ int ObPlanCache::get_ps_plan(
...
@@ -1509,6 +1510,8 @@ int ObPlanCache::get_ps_plan(
}
else
if
(
FALSE_IT
(
pc_ctx
.
fp_result_
.
cache_params_
=
}
else
if
(
FALSE_IT
(
pc_ctx
.
fp_result_
.
cache_params_
=
&
(
pc_ctx
.
exec_ctx_
.
get_physical_plan_ctx
()
->
get_param_store_for_update
())))
{
&
(
pc_ctx
.
exec_ctx_
.
get_physical_plan_ctx
()
->
get_param_store_for_update
())))
{
// do nothing
// do nothing
}
else
if
(
FALSE_IT
(
original_param_cnt
=
pc_ctx
.
fp_result_
.
cache_params_
->
count
()))
{
// do nothing
}
else
if
(
OB_FAIL
(
construct_plan_cache_key
(
pc_ctx
,
NS_CRSR
)))
{
}
else
if
(
OB_FAIL
(
construct_plan_cache_key
(
pc_ctx
,
NS_CRSR
)))
{
LOG_WARN
(
"fail to construnct plan cache key"
,
K
(
ret
));
LOG_WARN
(
"fail to construnct plan cache key"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
get_cache_obj
(
pc_ctx
,
cache_obj
)))
{
}
else
if
(
OB_FAIL
(
get_cache_obj
(
pc_ctx
,
cache_obj
)))
{
...
@@ -1528,6 +1531,7 @@ int ObPlanCache::get_ps_plan(
...
@@ -1528,6 +1531,7 @@ int ObPlanCache::get_ps_plan(
ObPsStmtId
new_stmt_id
=
pc_ctx
.
fp_result_
.
pc_key_
.
key_id_
;
ObPsStmtId
new_stmt_id
=
pc_ctx
.
fp_result_
.
pc_key_
.
key_id_
;
pc_ctx
.
fp_result_
.
pc_key_
.
key_id_
=
OB_INVALID_ID
;
pc_ctx
.
fp_result_
.
pc_key_
.
key_id_
=
OB_INVALID_ID
;
pc_ctx
.
fp_result_
.
pc_key_
.
name_
=
pc_ctx
.
raw_sql_
;
pc_ctx
.
fp_result_
.
pc_key_
.
name_
=
pc_ctx
.
raw_sql_
;
pc_ctx
.
exec_ctx_
.
get_physical_plan_ctx
()
->
restore_param_store
(
original_param_cnt
);
SQL_PC_LOG
(
SQL_PC_LOG
(
DEBUG
,
"start to get plan by sql"
,
K
(
new_stmt_id
),
K
(
pc_ctx
.
fp_result_
.
pc_key_
),
K
(
sql_pcvs_map_
.
size
()));
DEBUG
,
"start to get plan by sql"
,
K
(
new_stmt_id
),
K
(
pc_ctx
.
fp_result_
.
pc_key_
),
K
(
sql_pcvs_map_
.
size
()));
if
(
OB_FAIL
(
get_cache_obj
(
pc_ctx
,
cache_obj
)))
{
if
(
OB_FAIL
(
get_cache_obj
(
pc_ctx
,
cache_obj
)))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录