Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
4a421098
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看板
提交
4a421098
编写于
9月 07, 2021
作者:
M
my0
提交者:
wangzelin.wzl
9月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix outer join push down limit bug.
上级
ea1c6720
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
8 deletion
+13
-8
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.cpp
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.cpp
+12
-7
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h
+1
-1
未找到文件。
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.cpp
浏览文件 @
4a421098
...
...
@@ -128,12 +128,15 @@ int ObTransformOuterJoinLimitPushDown::check_basic(ObDMLStmt* stmt, OjLimitPushD
table_item
=
select_stmt
->
get_table_item
(
from_item
);
JoinedTable
*
joined_table
=
static_cast
<
JoinedTable
*>
(
table_item
);
bool
is_single_type
=
false
;
bool
has_generated_table
=
false
;
// only left outer allowed after right->left transformation
// mixed join type, such as left & inner is NOT allowed
if
(
OB_FAIL
(
check_join_type
(
joined_table
,
LEFT_OUTER_JOIN
,
is_single_type
)))
{
if
(
OB_FAIL
(
check_join_type
(
joined_table
,
LEFT_OUTER_JOIN
,
is_single_type
,
has_generated_table
)))
{
LOG_WARN
(
"failed to check deep tree type"
,
K
(
ret
));
}
else
if
(
!
is_single_type
)
{
is_valid
=
false
;
}
else
if
(
has_generated_table
&&
select_stmt
->
get_condition_size
()
>
0
)
{
is_valid
=
false
;
}
else
{
helper
.
select_stmt_
=
select_stmt
;
helper
.
is_limit_only_
=
!
select_stmt
->
has_order_by
();
...
...
@@ -238,7 +241,7 @@ int ObTransformOuterJoinLimitPushDown::check_offset_limit_expr(ObRawExpr* offset
}
int
ObTransformOuterJoinLimitPushDown
::
check_join_type
(
TableItem
*
table_item
,
ObJoinType
joined_type
,
bool
&
is_single_typ
e
)
TableItem
*
table_item
,
ObJoinType
joined_type
,
bool
&
is_single_type
,
bool
&
has_generated_tabl
e
)
{
int
ret
=
OB_SUCCESS
;
is_single_type
=
true
;
...
...
@@ -246,13 +249,16 @@ int ObTransformOuterJoinLimitPushDown::check_join_type(
if
(
OB_ISNULL
(
table_item
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"invalid table item"
,
K
(
ret
));
}
else
if
(
table_item
->
is_basic_table
()
||
table_item
->
is_generated_table
()
)
{
}
else
if
(
table_item
->
is_basic_table
())
{
// do nothing
}
else
if
(
table_item
->
is_joined_table
()
&&
static_cast
<
JoinedTable
*>
(
table_item
)
->
joined_type_
==
joined_type
)
{
JoinedTable
*
joined_table
=
static_cast
<
JoinedTable
*>
(
table_item
);
}
else
if
(
table_item
->
is_generated_table
())
{
has_generated_table
=
true
;
}
else
if
(
table_item
->
is_joined_table
()
&&
static_cast
<
JoinedTable
*>
(
table_item
)
->
joined_type_
==
joined_type
)
{
JoinedTable
*
joined_table
=
static_cast
<
JoinedTable
*>
(
table_item
);
// only need to check left side recursively after right to left formalization
bool
is_left_single_type
=
false
;
if
(
OB_FAIL
(
SMART_CALL
(
check_join_type
(
joined_table
->
left_table_
,
joined_type
,
is_left_single_type
))))
{
if
(
OB_FAIL
(
SMART_CALL
(
check_join_type
(
joined_table
->
left_table_
,
joined_type
,
is_left_single_type
,
has_generated_table
))))
{
LOG_WARN
(
"failed to check left child deep tree type"
,
K
(
ret
));
}
else
if
(
!
is_left_single_type
)
{
is_single_type
=
false
;
...
...
@@ -506,7 +512,6 @@ int ObTransformOuterJoinLimitPushDown::pushdown_view_table(ObSelectStmt* stmt, T
LOG_WARN
(
"failed to formalize generated_view"
,
K
(
ret
));
}
else
{
/* do nothing */
}
return
ret
;
}
...
...
src/sql/rewrite/ob_transform_outerjoin_limit_pushdown.h
浏览文件 @
4a421098
...
...
@@ -84,7 +84,7 @@ private:
int
check_limit
(
ObSelectStmt
*
select_stmt
,
bool
&
is_valid
);
int
check_join_type
(
TableItem
*
table_item
,
ObJoinType
joined_type
,
bool
&
is_type_deep
);
int
check_join_type
(
TableItem
*
table_item
,
ObJoinType
joined_type
,
bool
&
is_type_deep
,
bool
&
has_generated_table
);
int
find_target_table
(
ObSelectStmt
*
select_stmt
,
ObSqlBitSet
<>
table_ids
,
TableItem
*&
target_table
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录