Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
画布下的乐园
oceanbase
提交
bf65b0f0
O
oceanbase
项目概览
画布下的乐园
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf65b0f0
编写于
10月 28, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
10月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix parent namespace stmt bug
上级
766c19f8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
2 deletion
+31
-2
src/sql/optimizer/ob_log_plan.cpp
src/sql/optimizer/ob_log_plan.cpp
+2
-2
src/sql/resolver/dml/ob_dml_stmt.cpp
src/sql/resolver/dml/ob_dml_stmt.cpp
+16
-0
src/sql/resolver/dml/ob_dml_stmt.h
src/sql/resolver/dml/ob_dml_stmt.h
+1
-0
src/sql/resolver/dml/ob_select_stmt.cpp
src/sql/resolver/dml/ob_select_stmt.cpp
+12
-0
未找到文件。
src/sql/optimizer/ob_log_plan.cpp
浏览文件 @
bf65b0f0
...
...
@@ -1231,6 +1231,8 @@ int ObLogPlan::pre_process_quals(const ObIArray<TableItem*> &table_items,
} else {
ret = add_subquery_filter(qual);
}
} else if (qual->is_const_expr()) {
ret = add_startup_filter(qual);
} else if (qual->has_flag(CNT_RAND_FUNC) ||
qual->has_flag(CNT_USER_VARIABLE) ||
qual->has_flag(CNT_PL_UDF) ||
...
...
@@ -1238,8 +1240,6 @@ int ObLogPlan::pre_process_quals(const ObIArray<TableItem*> &table_items,
ret = add_special_expr(qual);
} else if (ObOptimizerUtil::has_hierarchical_expr(*qual)) {
ret = normal_quals.push_back(qual);
} else if (0 == qual->get_relation_ids().num_members()) {
ret = add_startup_filter(qual);
} else {
ret = normal_quals.push_back(qual);
}
...
...
src/sql/resolver/dml/ob_dml_stmt.cpp
浏览文件 @
bf65b0f0
...
...
@@ -2253,6 +2253,22 @@ int ObDMLStmt::get_from_subquery_stmts(ObIArray<ObSelectStmt*> &child_stmts) con
return
ret
;
}
int
ObDMLStmt
::
get_subquery_stmts
(
common
::
ObIArray
<
ObSelectStmt
*>
&
child_stmts
)
const
{
int
ret
=
OB_SUCCESS
;
for
(
int64_t
j
=
0
;
OB_SUCC
(
ret
)
&&
j
<
get_subquery_expr_size
();
++
j
)
{
ObQueryRefRawExpr
*
subquery_ref
=
subquery_exprs_
.
at
(
j
);
if
(
OB_ISNULL
(
subquery_ref
)
||
OB_ISNULL
(
subquery_ref
->
get_ref_stmt
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"subquery reference is null"
,
K
(
subquery_ref
));
}
else
if
(
OB_FAIL
(
child_stmts
.
push_back
(
subquery_ref
->
get_ref_stmt
())))
{
LOG_WARN
(
"stored subquery reference stmt failed"
,
K
(
ret
));
}
}
return
ret
;
}
int
ObDMLStmt
::
get_table_item
(
const
ObSQLSessionInfo
*
session_info
,
const
ObString
&
database_name
,
const
ObString
&
object_name
,
...
...
src/sql/resolver/dml/ob_dml_stmt.h
浏览文件 @
bf65b0f0
...
...
@@ -739,6 +739,7 @@ public:
virtual
int
remove_useless_sharable_expr
();
virtual
int
clear_sharable_expr_reference
();
virtual
int
get_from_subquery_stmts
(
common
::
ObIArray
<
ObSelectStmt
*>
&
child_stmts
)
const
;
virtual
int
get_subquery_stmts
(
common
::
ObIArray
<
ObSelectStmt
*>
&
child_stmts
)
const
;
int
is_referred_by_partitioning_expr
(
const
ObRawExpr
*
expr
,
bool
&
is_referred
);
int64_t
get_table_size
()
const
{
return
table_items_
.
count
();
}
...
...
src/sql/resolver/dml/ob_select_stmt.cpp
浏览文件 @
bf65b0f0
...
...
@@ -869,10 +869,13 @@ int ObSelectStmt::adjust_view_parent_namespace_stmt(ObDMLStmt *new_parent)
int
ret
=
OB_SUCCESS
;
int32_t
subquery_level
=
(
new_parent
!=
NULL
?
new_parent
->
get_current_level
()
+
1
:
0
);
ObArray
<
ObSelectStmt
*>
view_stmts
;
ObArray
<
ObSelectStmt
*>
subquery_stmts
;
set_parent_namespace_stmt
(
new_parent
);
set_current_level
(
subquery_level
);
if
(
OB_FAIL
(
get_from_subquery_stmts
(
view_stmts
)))
{
LOG_WARN
(
"get from subquery stmts failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
get_subquery_stmts
(
subquery_stmts
)))
{
LOG_WARN
(
"get subquery stmts failed"
,
K
(
ret
));
}
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
view_stmts
.
count
();
++
i
)
{
ObSelectStmt
*
view_stmt
=
view_stmts
.
at
(
i
);
...
...
@@ -883,6 +886,15 @@ int ObSelectStmt::adjust_view_parent_namespace_stmt(ObDMLStmt *new_parent)
LOG_WARN
(
"adjust view parent namespace stmt failed"
,
K
(
ret
));
}
}
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
subquery_stmts
.
count
();
++
i
)
{
ObSelectStmt
*
subquery
=
subquery_stmts
.
at
(
i
);
if
(
OB_ISNULL
(
subquery
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"table_item is null"
,
K
(
i
));
}
else
if
(
OB_FAIL
(
subquery
->
adjust_view_parent_namespace_stmt
(
this
)))
{
LOG_WARN
(
"adjust subquery parent namespace stmt failed"
,
K
(
ret
));
}
}
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录