Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
1be6c41e
O
oceanbase
项目概览
大炮V587
/
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,发现更多精彩内容 >>
提交
1be6c41e
编写于
12月 12, 2022
作者:
O
obdev
提交者:
ob-robot
1月 12, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix failed mysqltests caused by fixing rollup shared exprs bug and fixing core at inner_same_as
上级
06d62f76
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
6 deletion
+27
-6
src/sql/resolver/dml/ob_group_by_checker.cpp
src/sql/resolver/dml/ob_group_by_checker.cpp
+23
-4
src/sql/resolver/expr/ob_raw_expr.cpp
src/sql/resolver/expr/ob_raw_expr.cpp
+2
-1
src/sql/rewrite/ob_transform_utils.cpp
src/sql/rewrite/ob_transform_utils.cpp
+2
-1
未找到文件。
src/sql/resolver/dml/ob_group_by_checker.cpp
浏览文件 @
1be6c41e
...
...
@@ -326,6 +326,7 @@ int ObGroupByChecker::add_pc_const_param_info(ObExprEqualCheckContext &check_ctx
bool
ObGroupByChecker
::
find_in_rollup
(
ObRawExpr
&
expr
)
{
bool
found
=
false
;
bool
found_same_structure
=
false
;
ObStmtCompareContext
check_ctx
;
int
ret
=
OB_SUCCESS
;
if
(
OB_ISNULL
(
query_ctx_
))
{
...
...
@@ -352,7 +353,7 @@ bool ObGroupByChecker::find_in_rollup(ObRawExpr &expr)
check_ctx
.
override_const_compare_
=
true
;
check_ctx
.
override_query_compare_
=
true
;
if
(
expr
.
same_as
(
*
rollup_exprs_
->
at
(
nth_rollup
),
&
check_ctx
))
{
found
=
true
;
found
_same_structure
=
true
;
LOG_DEBUG
(
"found same structure in rollup exprs"
,
K
(
expr
));
}
}
...
...
@@ -360,7 +361,7 @@ bool ObGroupByChecker::find_in_rollup(ObRawExpr &expr)
}
}
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
found
&&
OB_SUCCESS
==
check_ctx
.
err_code_
)
{
}
else
if
(
(
found
||
found_same_structure
)
&&
OB_SUCCESS
==
check_ctx
.
err_code_
)
{
if
(
OB_FAIL
(
append
(
query_ctx_
->
all_equal_param_constraints_
,
check_ctx
.
equal_param_info_
)))
{
LOG_WARN
(
"failed to append equal params constraints"
,
K
(
ret
));
...
...
@@ -416,6 +417,7 @@ bool ObGroupByChecker::find_in_grouping_sets(ObRawExpr &expr)
{
int
ret
=
OB_SUCCESS
;
bool
found
=
false
;
bool
found_same_structure
=
false
;
ObStmtCompareContext
check_ctx
;
if
(
OB_ISNULL
(
query_ctx_
))
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
@@ -436,9 +438,26 @@ bool ObGroupByChecker::find_in_grouping_sets(ObRawExpr &expr)
}
}
}
if
(
OB_SUCCESS
==
check_ctx
.
err_code_
&&
!
found
&&
is_top_select_stmt
())
{
for
(
int64_t
nth_gs
=
0
;
!
found
&&
nth_gs
<
gs_cnt
;
++
nth_gs
)
{
int64_t
group_by_cnt
=
grouping_sets_exprs_
->
at
(
nth_gs
).
groupby_exprs_
.
count
();
//in oracle mode, only non static const expr will be replaced later in replace_group_by_exprs
for
(
int64_t
nth_group_by
=
0
;
!
found
&&
nth_group_by
<
group_by_cnt
;
++
nth_group_by
)
{
check_ctx
.
reset
();
check_ctx
.
ignore_param_
=
true
;
check_ctx
.
override_const_compare_
=
true
;
check_ctx
.
override_query_compare_
=
true
;
if
(
expr
.
same_as
(
*
grouping_sets_exprs_
->
at
(
nth_gs
).
groupby_exprs_
.
at
(
nth_group_by
),
&
check_ctx
))
{
found_same_structure
=
true
;
LOG_DEBUG
(
"found in grouping sets exprs"
,
K
(
expr
));
}
}
}
}
}
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
found
&&
OB_SUCCESS
==
check_ctx
.
err_code_
&&
lib
::
is_oracle_mode
())
{
}
else
if
(
(
found
||
found_same_structure
)
&&
OB_SUCCESS
==
check_ctx
.
err_code_
&&
lib
::
is_oracle_mode
())
{
if
(
OB_FAIL
(
append
(
query_ctx_
->
all_equal_param_constraints_
,
check_ctx
.
equal_param_info_
)))
{
LOG_WARN
(
"failed to append equal params constraints"
,
K
(
ret
));
...
...
@@ -605,7 +624,7 @@ int ObGroupByChecker::visit(ObConstRawExpr &expr)
}
}
else
if
(
find_in_rollup
(
expr
)
||
find_in_grouping_sets
(
expr
))
{
set_skip_expr
(
&
expr
);
}
else
if
(
OB_FAIL
(
add_abs_equal_constraint_in_grouping_sets
(
expr
)))
{
}
else
if
(
OB_FAIL
(
add_abs_equal_constraint_in_grouping_sets
(
expr
)))
{
LOG_WARN
(
"fail to add abs_equal constraintd"
,
K
(
ret
));
}
return
ret
;
...
...
src/sql/resolver/expr/ob_raw_expr.cpp
浏览文件 @
1be6c41e
...
...
@@ -3388,7 +3388,8 @@ bool ObSysFunRawExpr::inner_same_as(
if
(
get_expr_type
()
!=
expr
.
get_expr_type
())
{
}
else
if
(
T_FUN_SYS_RAND
==
get_expr_type
()
||
T_FUN_SYS_GUID
==
get_expr_type
())
{
}
else
if
(
expr
.
is_sys_func_expr
())
{
}
else
if
(
get_expr_class
()
==
expr
.
get_expr_class
())
{
//for EXPR_UDF and EXPR_SYS_FUNC
const
ObSysFunRawExpr
*
s_expr
=
static_cast
<
const
ObSysFunRawExpr
*>
(
&
expr
);
if
(
ObCharset
::
case_insensitive_equal
(
func_name_
,
s_expr
->
get_func_name
())
&&
this
->
get_param_count
()
==
s_expr
->
get_param_count
())
{
...
...
src/sql/rewrite/ob_transform_utils.cpp
浏览文件 @
1be6c41e
...
...
@@ -9256,7 +9256,8 @@ int ObTransformUtils::replace_with_groupby_exprs(ObSelectStmt *select_stmt,
if (OB_ISNULL(groupby_exprs.at(i))) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("got an unexpected null", K(ret));
} else if (groupby_exprs.at(i)->same_as(*expr, &check_context)) {
} else if ((is_mysql_mode() || !expr->is_static_const_expr())
&& groupby_exprs.at(i)->same_as(*expr, &check_context)) {
expr = groupby_exprs.at(i);
is_existed = true;
} else { /*do nothing.*/ }
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录