Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
80133e10
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看板
提交
80133e10
编写于
4月 25, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
4月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix core when no memory
上级
b2b9b757
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
23 deletion
+28
-23
src/sql/parser/parse_node.c
src/sql/parser/parse_node.c
+7
-7
src/sql/rewrite/ob_transform_utils.cpp
src/sql/rewrite/ob_transform_utils.cpp
+21
-16
未找到文件。
src/sql/parser/parse_node.c
浏览文件 @
80133e10
...
...
@@ -129,7 +129,7 @@ int count_child(ParseNode* root, void* malloc_pool, int* count)
do
{
ParseNode
*
tree
=
NULL
;
if
(
NULL
==
stack_top
||
NULL
==
(
tree
=
(
ParseNode
*
)
stack_top
->
val_
))
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR invalid null argument
\n
"
);
}
else
{
stack_top
=
stack_top
->
next_
;
...
...
@@ -142,7 +142,7 @@ int count_child(ParseNode* root, void* malloc_pool, int* count)
// do nothing
}
else
{
if
(
NULL
==
tree
->
children_
)
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR invalid null children
\n
"
);
}
ParserLinkNode
*
tmp_node
=
NULL
;
...
...
@@ -171,7 +171,7 @@ int merge_child(ParseNode* node, void* malloc_pool, ParseNode* source_tree, int*
int
ret
=
0
;
ParserLinkNode
*
stack_top
=
NULL
;
if
(
OB_UNLIKELY
(
NULL
==
node
||
NULL
==
index
))
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR node%p or index:%p is NULL
\n
"
,
node
,
index
);
}
else
if
(
NULL
==
source_tree
)
{
// do nothing
...
...
@@ -184,7 +184,7 @@ int merge_child(ParseNode* node, void* malloc_pool, ParseNode* source_tree, int*
do
{
ParseNode
*
tree
=
NULL
;
if
(
NULL
==
stack_top
||
NULL
==
(
tree
=
(
ParseNode
*
)
stack_top
->
val_
))
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR invalid null argument
\n
"
);
}
else
{
// pop stack
...
...
@@ -194,11 +194,11 @@ int merge_child(ParseNode* node, void* malloc_pool, ParseNode* source_tree, int*
// do nothing
}
else
if
(
T_LINK_NODE
!=
tree
->
type_
)
{
if
(
OB_UNLIKELY
(
*
index
<
0
||
*
index
>=
node
->
num_child_
))
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR invalid index: %d, num_child:%d
\n
tree: %d"
,
*
index
,
node
->
num_child_
,
tree
->
type_
);
}
else
if
(
NULL
==
node
->
children_
)
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR invalid null children pointer
\n
"
);
}
else
{
node
->
children_
[
*
index
]
=
tree
;
...
...
@@ -207,7 +207,7 @@ int merge_child(ParseNode* node, void* malloc_pool, ParseNode* source_tree, int*
}
else
if
(
tree
->
num_child_
<=
0
)
{
// do nothing
}
else
if
(
NULL
==
tree
->
children_
)
{
ret
=
OB_PARSER_ERR_
NO_MEMORY
;
ret
=
OB_PARSER_ERR_
UNEXPECTED
;
(
void
)
fprintf
(
stderr
,
"ERROR invalid children pointer
\n
"
);
}
else
{
ParserLinkNode
*
tmp_node
=
NULL
;
...
...
src/sql/rewrite/ob_transform_utils.cpp
浏览文件 @
80133e10
...
...
@@ -256,23 +256,28 @@ int ObTransformUtils::add_new_joined_table(ObTransformerCtx* ctx, ObDMLStmt& stm
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"transform context is invalid"
,
K
(
ret
),
K
(
ctx
),
K
(
stmt
),
K
(
left_table
),
K
(
right_table
));
}
else
{
JoinedTable
*
joined_table
=
static_cast
<
JoinedTable
*>
(
ctx
->
allocator_
->
alloc
(
sizeof
(
JoinedTable
)));
joined_table
=
new
(
joined_table
)
JoinedTable
();
joined_table
->
type_
=
TableItem
::
JOINED_TABLE
;
joined_table
->
table_id_
=
stmt
.
get_query_ctx
()
->
available_tb_id_
--
;
joined_table
->
joined_type_
=
join_type
;
joined_table
->
left_table_
=
left_table
;
joined_table
->
right_table_
=
right_table
;
if
(
OB_FAIL
(
joined_table
->
join_conditions_
.
assign
(
joined_conds
)))
{
LOG_WARN
(
"failed to push back join conditions"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObTransformUtils
::
add_joined_table_single_table_ids
(
*
joined_table
,
*
left_table
)))
{
LOG_WARN
(
"failed to add left table ids"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObTransformUtils
::
add_joined_table_single_table_ids
(
*
joined_table
,
*
right_table
)))
{
LOG_WARN
(
"failed to add right table ids"
,
K
(
ret
));
}
else
if
(
add_table
&&
OB_FAIL
(
stmt
.
add_joined_table
(
joined_table
)))
{
LOG_WARN
(
"failed to add joined table into stmt"
,
K
(
ret
));
JoinedTable
*
joined_table
=
static_cast
<
JoinedTable
*>
(
ctx
->
allocator_
->
alloc
(
sizeof
(
JoinedTable
)));
if
(
OB_ISNULL
(
joined_table
))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
LOG_WARN
(
"fail to allocate memory"
,
K
(
ret
));
}
else
{
new_join_table
=
joined_table
;
joined_table
=
new
(
joined_table
)
JoinedTable
();
joined_table
->
type_
=
TableItem
::
JOINED_TABLE
;
joined_table
->
table_id_
=
stmt
.
get_query_ctx
()
->
available_tb_id_
--
;
joined_table
->
joined_type_
=
join_type
;
joined_table
->
left_table_
=
left_table
;
joined_table
->
right_table_
=
right_table
;
if
(
OB_FAIL
(
joined_table
->
join_conditions_
.
assign
(
joined_conds
)))
{
LOG_WARN
(
"failed to push back join conditions"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObTransformUtils
::
add_joined_table_single_table_ids
(
*
joined_table
,
*
left_table
)))
{
LOG_WARN
(
"failed to add left table ids"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObTransformUtils
::
add_joined_table_single_table_ids
(
*
joined_table
,
*
right_table
)))
{
LOG_WARN
(
"failed to add right table ids"
,
K
(
ret
));
}
else
if
(
add_table
&&
OB_FAIL
(
stmt
.
add_joined_table
(
joined_table
)))
{
LOG_WARN
(
"failed to add joined table into stmt"
,
K
(
ret
));
}
else
{
new_join_table
=
joined_table
;
}
}
}
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录