Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天地威能
oceanbase
提交
97b7209e
O
oceanbase
项目概览
天地威能
/
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,发现更多精彩内容 >>
提交
97b7209e
编写于
11月 24, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix memory leak when forall batch execute
上级
f32896cc
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
25 addition
and
16 deletion
+25
-16
src/sql/ob_spi.cpp
src/sql/ob_spi.cpp
+12
-9
src/sql/ob_spi.h
src/sql/ob_spi.h
+2
-1
src/sql/ob_sql_utils.cpp
src/sql/ob_sql_utils.cpp
+9
-4
src/sql/ob_sql_utils.h
src/sql/ob_sql_utils.h
+2
-2
未找到文件。
src/sql/ob_spi.cpp
浏览文件 @
97b7209e
...
...
@@ -4661,7 +4661,8 @@ int ObSPIService::construct_exec_params(ObPLExecCtx *ctx,
const
ObSqlExpression
**
into_exprs
,
int64_t
into_count
,
ParamStore
&
exec_params
,
ObSPIOutParams
&
out_params
)
ObSPIOutParams
&
out_params
,
bool
is_forall
)
{
int
ret
=
OB_SUCCESS
;
ObObjParam
result
;
...
...
@@ -4723,6 +4724,7 @@ int ObSPIService::construct_exec_params(ObPLExecCtx *ctx,
}
if
(
OB_SUCC
(
ret
))
{
//执行期参数必须从PL的内存空间拷贝到SQL自己的内存空间,以防止在SQL执行过程中参数被改掉
ObObjParam
new_param
=
result
;
if
(
!
is_forall
)
{
// forall场景, 不做拷贝, 上层代码transform_pl_ext_type会进行paramstore整体拷贝
if
(
result
.
is_pl_extend
())
{
if
(
result
.
get_meta
().
get_extend_type
()
!=
PL_REF_CURSOR_TYPE
)
{
new_param
.
set_int_value
(
0
);
...
...
@@ -4731,6 +4733,7 @@ int ObSPIService::construct_exec_params(ObPLExecCtx *ctx,
}
else
{
OZ
(
deep_copy_obj
(
param_allocator
,
result
,
new_param
));
}
}
OX
(
new_param
.
set_need_to_check_type
(
true
));
OZ
(
exec_params
.
push_back
(
new_param
));
}
...
...
@@ -4804,7 +4807,7 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
if
(
NULL
==
sql
)
{
OZ
(
construct_exec_params
(
ctx
,
param_allocator
,
param_exprs
,
param_count
,
into_exprs
,
into_count
,
exec_params
,
out_params
),
into_exprs
,
into_count
,
exec_params
,
out_params
,
is_forall
),
K
(
sql
),
K
(
id
),
K
(
type
),
K
(
param_count
),
K
(
out_params
),
K
(
exec_params
));
}
...
...
@@ -4824,7 +4827,7 @@ int ObSPIService::inner_open(ObPLExecCtx *ctx,
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"array_binding_count is wrong"
,
K
(
array_binding_count
),
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObSQLUtils
::
transform_pl_ext_type
(
exec_params
,
array_binding_count
,
param_allocator
,
batch_params
)))
{
exec_params
,
array_binding_count
,
param_allocator
,
batch_params
,
true
)))
{
LOG_WARN
(
"transform failed"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
batch_params
))
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
src/sql/ob_spi.h
浏览文件 @
97b7209e
...
...
@@ -626,7 +626,8 @@ private:
const
ObSqlExpression
**
into_exprs
,
int64_t
into_count
,
ParamStore
&
exec_params
,
ObSPIOutParams
&
out_params
);
ObSPIOutParams
&
out_params
,
bool
is_forall
=
false
);
static
int
inner_open
(
pl
::
ObPLExecCtx
*
ctx
,
ObIAllocator
&
param_allocator
,
//用于拷贝执行期参数
...
...
src/sql/ob_sql_utils.cpp
浏览文件 @
97b7209e
...
...
@@ -4417,7 +4417,8 @@ int ObSQLUtils::get_one_group_params(int64_t &actual_pos, ParamStore &src, Param
return
ret
;
}
int
ObSQLUtils
::
copy_params_to_array_params
(
int64_t
query_pos
,
ParamStore
&
src
,
ParamStore
&
dst
)
int
ObSQLUtils
::
copy_params_to_array_params
(
int64_t
query_pos
,
ParamStore
&
src
,
ParamStore
&
dst
,
ObIAllocator
&
alloc
,
bool
is_forall
)
{
int
ret
=
OB_SUCCESS
;
for
(
int64_t
j
=
0
;
OB_SUCC
(
ret
)
&&
j
<
dst
.
count
();
j
++
)
{
...
...
@@ -4431,7 +4432,11 @@ int ObSQLUtils::copy_params_to_array_params(int64_t query_pos, ParamStore &src,
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"get unexpected null"
,
K
(
ret
),
KPC
(
array_params
));
}
else
{
array_params
->
data_
[
query_pos
]
=
src
.
at
(
j
);
ObObjParam
new_param
=
src
.
at
(
j
);
if
(
is_forall
)
{
OZ
(
deep_copy_obj
(
alloc
,
src
.
at
(
j
),
new_param
));
}
array_params
->
data_
[
query_pos
]
=
new_param
;
}
}
return
ret
;
...
...
@@ -4463,7 +4468,7 @@ int ObSQLUtils::init_elements_info(ParamStore &src, ParamStore &dst)
}
int
ObSQLUtils
::
transform_pl_ext_type
(
ParamStore
&
src
,
int64_t
array_binding_size
,
ObIAllocator
&
alloc
,
ParamStore
*&
dst
)
ParamStore
&
src
,
int64_t
array_binding_size
,
ObIAllocator
&
alloc
,
ParamStore
*&
dst
,
bool
is_forall
)
{
int
ret
=
OB_SUCCESS
;
ParamStore
*
ps_ab_params
=
NULL
;
...
...
@@ -4489,7 +4494,7 @@ int ObSQLUtils::transform_pl_ext_type(
LOG_WARN
(
"fail to reverse params_store"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
get_one_group_params
(
actual_pos
,
src
,
temp_obj_params
)))
{
LOG_WARN
(
"get one group params failed"
,
K
(
ret
),
K
(
actual_pos
));
}
else
if
(
OB_FAIL
(
copy_params_to_array_params
(
query_pos
,
temp_obj_params
,
*
dst
)))
{
}
else
if
(
OB_FAIL
(
copy_params_to_array_params
(
query_pos
,
temp_obj_params
,
*
dst
,
alloc
,
is_forall
)))
{
LOG_WARN
(
"copy params to array params failed"
,
K
(
ret
),
K
(
query_pos
));
}
else
if
(
query_pos
==
0
)
{
if
(
OB_FAIL
(
init_elements_info
(
src
,
*
dst
)))
{
...
...
src/sql/ob_sql_utils.h
浏览文件 @
97b7209e
...
...
@@ -536,9 +536,9 @@ public:
int64_t
query_num
,
int64_t
param_num
,
ParamStore
&
param_store
);
static
int
transform_pl_ext_type
(
ParamStore
&
src
,
int64_t
array_binding_size
,
ObIAllocator
&
alloc
,
ParamStore
*&
dst
);
static
int
transform_pl_ext_type
(
ParamStore
&
src
,
int64_t
array_binding_size
,
ObIAllocator
&
alloc
,
ParamStore
*&
dst
,
bool
is_forall
=
false
);
static
int
get_one_group_params
(
int64_t
&
pos
,
ParamStore
&
src
,
ParamStore
&
obj_params
);
static
int
copy_params_to_array_params
(
int64_t
query_pos
,
ParamStore
&
src
,
ParamStore
&
dst
);
static
int
copy_params_to_array_params
(
int64_t
query_pos
,
ParamStore
&
src
,
ParamStore
&
dst
,
ObIAllocator
&
alloc
,
bool
is_forall
=
false
);
static
int
init_elements_info
(
ParamStore
&
src
,
ParamStore
&
dst
);
/*-----------------------
* Observer no longer depends on Linux NTP service to adjust server time since 4.0.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录