Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
a87cb431
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a87cb431
编写于
9月 17, 2021
作者:
M
my0
提交者:
wangzelin.wzl
9月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix view merge bug when there is a rand() function in select items of view.
上级
9e46649a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
1 deletion
+15
-1
src/sql/rewrite/ob_transform_groupby_placement.cpp
src/sql/rewrite/ob_transform_groupby_placement.cpp
+6
-0
src/sql/rewrite/ob_transform_view_merge.cpp
src/sql/rewrite/ob_transform_view_merge.cpp
+9
-1
未找到文件。
src/sql/rewrite/ob_transform_groupby_placement.cpp
浏览文件 @
a87cb431
...
@@ -1548,6 +1548,7 @@ int ObTransformGroupByPlacement::check_groupby_pullup_validity(ObDMLStmt* stmt,
...
@@ -1548,6 +1548,7 @@ int ObTransformGroupByPlacement::check_groupby_pullup_validity(ObDMLStmt* stmt,
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
bool
can_pullup
=
false
;
bool
can_pullup
=
false
;
bool
has_rand
=
false
;
if
(
OB_ISNULL
(
stmt
)
||
OB_ISNULL
(
table
))
{
if
(
OB_ISNULL
(
stmt
)
||
OB_ISNULL
(
table
))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"param has null"
,
K
(
stmt
),
K
(
table
),
K
(
ret
));
LOG_WARN
(
"param has null"
,
K
(
stmt
),
K
(
table
),
K
(
ret
));
...
@@ -1574,6 +1575,11 @@ int ObTransformGroupByPlacement::check_groupby_pullup_validity(ObDMLStmt* stmt,
...
@@ -1574,6 +1575,11 @@ int ObTransformGroupByPlacement::check_groupby_pullup_validity(ObDMLStmt* stmt,
LOG_WARN
(
"failed to check null propagate select expr"
,
K
(
ret
));
LOG_WARN
(
"failed to check null propagate select expr"
,
K
(
ret
));
}
else
if
(
!
can_pullup
)
{
}
else
if
(
!
can_pullup
)
{
// do nothing
// do nothing
}
else
if
(
OB_FAIL
(
sub_stmt
->
has_rand
(
has_rand
)))
{
LOG_WARN
(
"failed to check stmt has rand func"
,
K
(
ret
));
// stmt不能包含rand函数 https://work.aone.alibaba-inc.com/issue/35875561
}
else
if
(
!
(
can_pullup
=
!
has_rand
))
{
// do nothing
}
else
if
(
OB_FALSE_IT
(
helper
.
need_merge_
=
sub_stmt
->
get_stmt_hint
().
enable_view_merge
()))
{
}
else
if
(
OB_FALSE_IT
(
helper
.
need_merge_
=
sub_stmt
->
get_stmt_hint
().
enable_view_merge
()))
{
}
else
if
(
OB_FAIL
(
valid_views
.
push_back
(
helper
)))
{
}
else
if
(
OB_FAIL
(
valid_views
.
push_back
(
helper
)))
{
LOG_WARN
(
"failed to push back group stmt index"
,
K
(
ret
));
LOG_WARN
(
"failed to push back group stmt index"
,
K
(
ret
));
...
...
src/sql/rewrite/ob_transform_view_merge.cpp
浏览文件 @
a87cb431
...
@@ -346,7 +346,15 @@ int ObTransformViewMerge::check_can_be_unnested(
...
@@ -346,7 +346,15 @@ int ObTransformViewMerge::check_can_be_unnested(
LOG_WARN
(
"NULL expr"
,
K
(
ret
));
LOG_WARN
(
"NULL expr"
,
K
(
ret
));
}
else
if
(
expr
->
has_flag
(
CNT_SUB_QUERY
))
{
}
else
if
(
expr
->
has_flag
(
CNT_SUB_QUERY
))
{
can_be
=
false
;
can_be
=
false
;
}
else
{
/*do nothing*/
}
}
// stmt不能包含rand函数 https://work.aone.alibaba-inc.com/issue/35875561
if
(
OB_SUCC
(
ret
)
&&
can_be
)
{
bool
has_rand
=
false
;
if
(
OB_FAIL
(
child_stmt
->
has_rand
(
has_rand
)))
{
LOG_WARN
(
"failed to get rand flag"
,
K
(
ret
));
}
else
{
can_be
=
!
has_rand
;
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录