Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caoersss
oceanbase
提交
a4d3ae7d
O
oceanbase
项目概览
caoersss
/
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,发现更多精彩内容 >>
提交
a4d3ae7d
编写于
3月 15, 2022
作者:
L
leslieyuchen
提交者:
LINGuanRen
3月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix print remote sql info coredump
上级
58698cf4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
10 deletion
+33
-10
src/sql/engine/ob_physical_plan_ctx.cpp
src/sql/engine/ob_physical_plan_ctx.cpp
+26
-1
src/sql/engine/ob_physical_plan_ctx.h
src/sql/engine/ob_physical_plan_ctx.h
+3
-2
src/sql/executor/ob_task.cpp
src/sql/executor/ob_task.cpp
+1
-0
src/sql/ob_sql.cpp
src/sql/ob_sql.cpp
+2
-0
src/sql/ob_sql_utils.cpp
src/sql/ob_sql_utils.cpp
+1
-7
未找到文件。
src/sql/engine/ob_physical_plan_ctx.cpp
浏览文件 @
a4d3ae7d
...
...
@@ -21,12 +21,37 @@
#include "sql/engine/ob_exec_context.h"
#include "sql/engine/ob_physical_plan.h"
#include "sql/engine/px/ob_dfo.h"
#include "lib/utility/ob_print_utils.h"
namespace
oceanbase
{
using
namespace
common
;
using
namespace
share
;
using
namespace
transaction
;
namespace
sql
{
ObPhysicalPlanCtx
::
ObPhysicalPlanCtx
(
common
::
ObIAllocator
&
allocator
)
DEF_TO_STRING
(
ObRemoteSqlInfo
)
{
int64_t
pos
=
0
;
J_OBJ_START
();
J_KV
(
K_
(
use_ps
),
K_
(
is_batched_stmt
),
K_
(
ps_param_cnt
),
K_
(
remote_sql
));
J_COMMA
();
J_NAME
(
"ps_params"
);
J_COLON
();
if
(
OB_ISNULL
(
ps_params_
)
||
ps_param_cnt_
<=
0
)
{
J_NULL
();
}
else
{
J_ARRAY_START
();
for
(
int64_t
i
=
0
;
pos
<
buf_len
&&
i
<
ps_param_cnt_
;
++
i
)
{
BUF_PRINTO
(
ps_params_
->
at
(
i
));
if
(
i
!=
ps_param_cnt_
-
1
)
{
J_COMMA
();
}
}
J_ARRAY_END
();
}
J_OBJ_END
();
return
pos
;
}
ObPhysicalPlanCtx
::
ObPhysicalPlanCtx
(
common
::
ObIAllocator
&
allocator
)
:
allocator_
(
allocator
),
tenant_id_
(
OB_INVALID_ID
),
tsc_snapshot_timestamp_
(
0
),
...
...
src/sql/engine/ob_physical_plan_ctx.h
浏览文件 @
a4d3ae7d
...
...
@@ -43,13 +43,14 @@ typedef common::ObFixedArray<PartParamIdxArray, common::ObIAllocator> BatchParam
typedef
common
::
ObFixedArray
<
ObImplicitCursorInfo
,
common
::
ObIAllocator
>
ImplicitCursorInfoArray
;
struct
ObRemoteSqlInfo
{
ObRemoteSqlInfo
()
:
use_ps_
(
false
),
is_batched_stmt_
(
false
),
remote_sql_
(),
ps_params_
(
nullptr
)
ObRemoteSqlInfo
()
:
use_ps_
(
false
),
is_batched_stmt_
(
false
),
ps_param_cnt_
(
0
),
remote_sql_
(),
ps_params_
(
nullptr
)
{}
TO_STRING_KV
(
K_
(
use_ps
),
K_
(
is_batched_stmt
),
K_
(
remote_sql
),
KPC_
(
ps_params
))
;
DECLARE_TO_STRING
;
bool
use_ps_
;
bool
is_batched_stmt_
;
int32_t
ps_param_cnt_
;
common
::
ObString
remote_sql_
;
ParamStore
*
ps_params_
;
};
...
...
src/sql/executor/ob_task.cpp
浏览文件 @
a4d3ae7d
...
...
@@ -684,6 +684,7 @@ OB_DEF_DESERIALIZE(ObRemoteTask)
*
ps_params
,
tenant_id
);
if
(
OB_SUCC
(
ret
))
{
remote_sql_info_
->
ps_param_cnt_
=
static_cast
<
int32_t
>
(
ps_params
->
count
());
if
(
OB_FAIL
(
exec_ctx_
->
create_my_session
(
tenant_id
)))
{
LOG_WARN
(
"create my session failed"
,
K
(
ret
),
K
(
tenant_id
));
}
else
{
...
...
src/sql/ob_sql.cpp
浏览文件 @
a4d3ae7d
...
...
@@ -3066,6 +3066,7 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx, ObSQLSessionInfo &session, ObP
pctx
->
get_remote_sql_info
().
use_ps_
=
true
;
pctx
->
get_remote_sql_info
().
remote_sql_
=
pc_ctx
.
sql_ctx_
.
cur_sql_
;
pctx
->
get_remote_sql_info
().
ps_params_
=
&
param_store
;
pctx
->
get_remote_sql_info
().
ps_param_cnt_
=
static_cast
<
int32_t
>
(
param_store
.
count
());
}
else
if
(
phy_plan
->
temp_sql_can_prepare
()
&&
pc_ctx
.
neg_param_index_
.
is_empty
()
&&
!
pc_ctx
.
sql_ctx_
.
multi_stmt_item_
.
is_batched_multi_stmt
())
{
LOG_DEBUG
(
"after get plan"
,
...
...
@@ -3079,6 +3080,7 @@ int ObSql::after_get_plan(ObPlanCacheCtx &pc_ctx, ObSQLSessionInfo &session, ObP
pctx
->
get_remote_sql_info
().
use_ps_
=
true
;
pctx
->
get_remote_sql_info
().
remote_sql_
=
phy_plan
->
get_constructed_sql
();
pctx
->
get_remote_sql_info
().
ps_params_
=
&
param_store
;
pctx
->
get_remote_sql_info
().
ps_param_cnt_
=
static_cast
<
int32_t
>
(
param_store
.
count
());
}
else
{
param_store
.
reset
();
pctx
->
get_remote_sql_info
().
use_ps_
=
false
;
...
...
src/sql/ob_sql_utils.cpp
浏览文件 @
a4d3ae7d
...
...
@@ -108,9 +108,6 @@ int ObSQLUtils::md5(const ObString& stmt, char* sql_id, int32_t len)
reinterpret_cast
<
unsigned
char
*>
(
md5_sum_buf
));
if
(
OB_ISNULL
(
res
))
{
// MD5() in openssl always return an pointer not NULL, so we need not check return value.
// see:
// http://www.openssl.org/docs/crypto/md5.html#DESCRIPTION
// http://www.openssl.org/docs/crypto/md5.html#RETURN_VALUES
// Even so, we HAVE TO check it here. You know it.
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"md5 res null pointer"
,
K
(
ret
),
K
(
res
));
...
...
@@ -3237,10 +3234,7 @@ int ObVirtualTableResultConverter::convert_key_ranges(ObIArray<ObNewRange>& key_
if
(
!
key_ranges
.
empty
())
{
common
::
ObArray
<
common
::
ObNewRange
>
tmp_range
;
OZ
(
tmp_range
.
reserve
(
key_ranges
.
count
()));
if
(
OB_ISNULL
(
key_types_
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"key mapping is null"
,
K
(
ret
));
}
CK
(
OB_NOT_NULL
(
key_types_
));
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
key_ranges
.
count
();
++
i
)
{
ObNewRange
new_range
;
new_range
.
table_id_
=
key_ranges
.
at
(
i
).
table_id_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录