Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
3e6a171f
O
oceanbase
项目概览
clmforever
/
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,发现更多精彩内容 >>
提交
3e6a171f
编写于
11月 15, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix used incorrect cached temp expr ctx bug
上级
042a195f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
33 addition
and
19 deletion
+33
-19
src/sql/engine/cmd/ob_load_data_impl.cpp
src/sql/engine/cmd/ob_load_data_impl.cpp
+2
-0
src/sql/engine/expr/ob_expr_to_outfile_row.cpp
src/sql/engine/expr/ob_expr_to_outfile_row.cpp
+3
-3
src/sql/engine/ob_des_exec_context.cpp
src/sql/engine/ob_des_exec_context.cpp
+1
-0
src/sql/engine/ob_exec_context.cpp
src/sql/engine/ob_exec_context.cpp
+21
-16
src/sql/engine/ob_exec_context.h
src/sql/engine/ob_exec_context.h
+3
-0
src/sql/executor/ob_executor.cpp
src/sql/executor/ob_executor.cpp
+1
-0
src/sql/executor/ob_remote_executor_processor.cpp
src/sql/executor/ob_remote_executor_processor.cpp
+2
-0
未找到文件。
src/sql/engine/cmd/ob_load_data_impl.cpp
浏览文件 @
3e6a171f
...
...
@@ -1021,6 +1021,8 @@ int ObLoadDataSPImpl::exec_shuffle(int64_t task_id, ObShuffleTaskHandle *handle)
LOG_WARN
(
"fail to init buffer"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
parse_result
.
prepare_allocate
(
handle
->
generator
.
get_field_exprs
().
count
())))
{
LOG_WARN
(
"fail to allocate"
,
K
(
ret
));
}
else
{
handle
->
exec_ctx
.
set_use_temp_expr_ctx_cache
(
true
);
}
while
(
OB_SUCC
(
ret
)
&&
ptr
<
end
)
{
...
...
src/sql/engine/expr/ob_expr_to_outfile_row.cpp
浏览文件 @
3e6a171f
...
...
@@ -229,9 +229,9 @@ int ObExprToOutfileRow::extract_fisrt_wchar_from_varhcar(const ObObj &obj, int32
// as NULL, not \N.
int
ObExprToOutfileRow
::
print_field
(
char
*
buf
,
const
int64_t
buf_len
,
int64_t
&
pos
,
const
ObObj
&
obj
,
ObExprOutFileInfo
&
out_info
)
{
int
ret
=
OB_SUCCESS
;
int64_t
tmp_pos
=
0
;
{
int
ret
=
OB_SUCCESS
;
int64_t
tmp_pos
=
0
;
const
bool
need_enclose
=
0
!=
out_info
.
wchar_enclose_
&&
(
!
out_info
.
is_optional_
||
obj
.
is_string_type
());
if
(
need_enclose
)
{
...
...
src/sql/engine/ob_des_exec_context.cpp
浏览文件 @
3e6a171f
...
...
@@ -216,6 +216,7 @@ DEFINE_DESERIALIZE(ObDesExecContext)
LOG_WARN
(
"init exec context expr op failed"
,
K
(
ret
));
}
}
use_temp_expr_ctx_cache_
=
true
;
return
ret
;
}
}
/* ns sql*/
...
...
src/sql/engine/ob_exec_context.cpp
浏览文件 @
3e6a171f
...
...
@@ -112,6 +112,7 @@ ObExecContext::ObExecContext(ObIAllocator &allocator)
px_batch_id_
(
0
),
admission_version_
(
UINT64_MAX
),
admission_addr_map_
(),
use_temp_expr_ctx_cache_
(
false
),
temp_expr_ctx_map_
(),
dml_event_
(
ObDmlEventType
::
DE_INVALID
),
update_columns_
(
nullptr
),
...
...
@@ -301,25 +302,29 @@ int ObExecContext::get_temp_expr_eval_ctx(const ObTempExpr &temp_expr,
ObTempExprCtx
*&
temp_expr_ctx
)
{
int
ret
=
OB_SUCCESS
;
if
(
!
temp_expr_ctx_map_
.
created
())
{
OZ
(
temp_expr_ctx_map_
.
create
(
8
,
ObLabel
(
"TempExprCtx"
)));
}
if
(
OB_SUCC
(
ret
))
{
int64_t
ctx_ptr
=
0
;
if
(
OB_FAIL
(
temp_expr_ctx_map_
.
get_refactored
(
reinterpret_cast
<
int64_t
>
(
&
temp_expr
),
ctx_ptr
)))
{
if
(
OB_HASH_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
OZ
(
build_temp_expr_ctx
(
temp_expr
,
temp_expr_ctx
));
CK
(
OB_NOT_NULL
(
temp_expr_ctx
));
OZ
(
temp_expr_ctx_map_
.
set_refactored
(
reinterpret_cast
<
int64_t
>
(
&
temp_expr
),
reinterpret_cast
<
int64_t
>
(
temp_expr_ctx
)));
if
(
use_temp_expr_ctx_cache_
)
{
if
(
!
temp_expr_ctx_map_
.
created
())
{
OZ
(
temp_expr_ctx_map_
.
create
(
8
,
ObLabel
(
"TempExprCtx"
)));
}
if
(
OB_SUCC
(
ret
))
{
int64_t
ctx_ptr
=
0
;
if
(
OB_FAIL
(
temp_expr_ctx_map_
.
get_refactored
(
reinterpret_cast
<
int64_t
>
(
&
temp_expr
),
ctx_ptr
)))
{
if
(
OB_HASH_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
OZ
(
build_temp_expr_ctx
(
temp_expr
,
temp_expr_ctx
));
CK
(
OB_NOT_NULL
(
temp_expr_ctx
));
OZ
(
temp_expr_ctx_map_
.
set_refactored
(
reinterpret_cast
<
int64_t
>
(
&
temp_expr
),
reinterpret_cast
<
int64_t
>
(
temp_expr_ctx
)));
}
else
{
LOG_WARN
(
"fail to get temp expr ctx"
,
K
(
temp_expr
),
K
(
ret
));
}
}
else
{
LOG_WARN
(
"fail to get temp expr ctx"
,
K
(
temp_expr
),
K
(
ret
)
);
temp_expr_ctx
=
reinterpret_cast
<
ObTempExprCtx
*>
(
ctx_ptr
);
}
}
else
{
temp_expr_ctx
=
reinterpret_cast
<
ObTempExprCtx
*>
(
ctx_ptr
);
}
}
else
{
OZ
(
build_temp_expr_ctx
(
temp_expr
,
temp_expr_ctx
));
}
return
ret
;
...
...
src/sql/engine/ob_exec_context.h
浏览文件 @
3e6a171f
...
...
@@ -369,6 +369,8 @@ public:
// for granule iterator
int
get_gi_task_map
(
GIPrepareTaskMap
*&
gi_prepare_task_map
);
void
set_use_temp_expr_ctx_cache
(
bool
v
)
{
use_temp_expr_ctx_cache_
=
v
;
}
// for udf
int
get_udf_ctx_mgr
(
ObUdfCtxMgr
*&
udf_ctx_mgr
);
...
...
@@ -599,6 +601,7 @@ protected:
uint64_t
admission_version_
;
hash
::
ObHashMap
<
ObAddr
,
int64_t
>
admission_addr_map_
;
// used for temp expr ctx manager
bool
use_temp_expr_ctx_cache_
;
hash
::
ObHashMap
<
int64_t
,
int64_t
>
temp_expr_ctx_map_
;
// for pl/trigger
ObDmlEventType
dml_event_
;
...
...
src/sql/executor/ob_executor.cpp
浏览文件 @
3e6a171f
...
...
@@ -59,6 +59,7 @@ int ObExecutor::execute_plan(ObExecContext &ctx)
ObSQLSessionInfo
*
session_info
=
ctx
.
get_my_session
();
ObPhysicalPlanCtx
*
plan_ctx
=
ctx
.
get_physical_plan_ctx
();
int64_t
batched_stmt_cnt
=
ctx
.
get_sql_ctx
()
->
multi_stmt_item_
.
get_batched_stmt_cnt
();
ctx
.
set_use_temp_expr_ctx_cache
(
true
);
// If the batch execution is rewritten by insert multi values, there is no need to repack multiple times
if
(
ctx
.
get_sql_ctx
()
->
multi_stmt_item_
.
is_ins_multi_val_opt
())
{
batched_stmt_cnt
=
0
;
...
...
src/sql/executor/ob_remote_executor_processor.cpp
浏览文件 @
3e6a171f
...
...
@@ -426,6 +426,7 @@ int ObRemoteBaseExecuteP<T>::execute_remote_plan(ObExecContext &exec_ctx,
ObSQLSessionInfo
*
session
=
exec_ctx
.
get_my_session
();
ObPhysicalPlanCtx
*
plan_ctx
=
exec_ctx
.
get_physical_plan_ctx
();
ObOperator
*
se_op
=
nullptr
;
// static engine operator
exec_ctx
.
set_use_temp_expr_ctx_cache
(
true
);
if
(
OB_ISNULL
(
plan_ctx
)
||
OB_ISNULL
(
session
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"op is NULL"
,
K
(
ret
),
K
(
plan_ctx
),
K
(
session
));
...
...
@@ -633,6 +634,7 @@ int ObRemoteBaseExecuteP<T>::execute_with_sql(ObRemoteTask &task)
bool
enable_sql_audit
=
GCONF
.
enable_sql_audit
;
ObPhysicalPlan
*
plan
=
nullptr
;
ObPhysicalPlanCtx
*
plan_ctx
=
nullptr
;
exec_ctx_
.
set_use_temp_expr_ctx_cache
(
false
);
int
inject_err_no
=
EVENT_CALL
(
EventTable
::
EN_REMOTE_EXEC_ERR
);
if
(
0
!=
inject_err_no
)
{
ret
=
inject_err_no
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录