Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
4c8ccd1f
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看板
提交
4c8ccd1f
编写于
6月 21, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
6月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix shared exprs bug after view merge
上级
81366295
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
11 deletion
+25
-11
src/sql/code_generator/ob_code_generator_impl.cpp
src/sql/code_generator/ob_code_generator_impl.cpp
+8
-7
src/sql/code_generator/ob_expr_generator_impl.cpp
src/sql/code_generator/ob_expr_generator_impl.cpp
+17
-4
未找到文件。
src/sql/code_generator/ob_code_generator_impl.cpp
浏览文件 @
4c8ccd1f
...
@@ -9170,16 +9170,17 @@ int ObCodeGeneratorImpl::get_cell_idx(
...
@@ -9170,16 +9170,17 @@ int ObCodeGeneratorImpl::get_cell_idx(
if
(
OB_ISNULL
(
raw_expr
))
{
if
(
OB_ISNULL
(
raw_expr
))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"Get unexpected null"
,
K
(
ret
));
LOG_WARN
(
"Get unexpected null"
,
K
(
ret
));
}
else
if
(
!
raw_expr
->
has_flag
(
IS_COLUMNLIZED
))
{
}
else
if
(
raw_expr
->
has_flag
(
IS_CONST
)
||
raw_expr
->
has_flag
(
IS_CONST_EXPR
))
{
if
(
raw_expr
->
has_flag
(
IS_CONST
)
||
raw_expr
->
has_flag
(
IS_CONST_EXPR
))
{
skip
=
true
;
skip
=
true
;
LOG_TRACE
(
"skip const expr"
,
K
(
*
raw_expr
),
K
(
cell_idx
));
}
else
{
}
if
(
OB_SUCC
(
ret
)
&&
!
skip
)
{
if
(
!
raw_expr
->
has_flag
(
IS_COLUMNLIZED
))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"param expr should have be columnlized"
,
K
(
*
raw_expr
));
LOG_ERROR
(
"param expr should have be columnlized"
,
K
(
*
raw_expr
));
}
else
if
(
OB_FAIL
(
idx_provider
.
get_idx
(
raw_expr
,
cell_idx
)))
{
LOG_ERROR
(
"partition by expr should have be columnlized"
,
K
(
ret
),
K
(
*
raw_expr
));
}
}
}
else
if
(
OB_FAIL
(
idx_provider
.
get_idx
(
raw_expr
,
cell_idx
)))
{
LOG_ERROR
(
"partition by expr should have be columnlized"
,
K
(
ret
),
K
(
*
raw_expr
));
}
else
{
/* do nothing. */
}
}
return
ret
;
return
ret
;
}
}
...
...
src/sql/code_generator/ob_expr_generator_impl.cpp
浏览文件 @
4c8ccd1f
...
@@ -119,7 +119,7 @@ int ObExprGeneratorImpl::generate_infix_expr(ObRawExpr& raw_expr)
...
@@ -119,7 +119,7 @@ int ObExprGeneratorImpl::generate_infix_expr(ObRawExpr& raw_expr)
sql_expr_
->
start_gen_infix_exr
();
sql_expr_
->
start_gen_infix_exr
();
auto
&
exprs
=
sql_expr_
->
get_infix_expr
().
get_exprs
();
auto
&
exprs
=
sql_expr_
->
get_infix_expr
().
get_exprs
();
if
(
OB_FAIL
(
raw_expr
.
do_visit
(
*
this
)))
{
if
(
OB_FAIL
(
raw_expr
.
do_visit
(
*
this
)))
{
LOG_WARN
(
"expr visit failed"
,
K
(
ret
));
LOG_WARN
(
"expr visit failed"
,
K
(
ret
)
,
K
(
raw_expr
)
);
}
else
if
(
exprs
.
count
()
>
1
)
{
}
else
if
(
exprs
.
count
()
>
1
)
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"should add one expr per visit"
,
K
(
ret
),
K
(
raw_expr
));
LOG_WARN
(
"should add one expr per visit"
,
K
(
ret
),
K
(
raw_expr
));
...
@@ -1299,6 +1299,7 @@ int ObExprGeneratorImpl::visit(ObCaseOpRawExpr& expr)
...
@@ -1299,6 +1299,7 @@ int ObExprGeneratorImpl::visit(ObCaseOpRawExpr& expr)
{
{
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
ObPostExprItem
item
;
ObPostExprItem
item
;
bool
need_calc
=
true
;
item
.
set_accuracy
(
expr
.
get_accuracy
());
item
.
set_accuracy
(
expr
.
get_accuracy
());
if
(
OB_ISNULL
(
sql_expr_
))
{
if
(
OB_ISNULL
(
sql_expr_
))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
...
@@ -1306,14 +1307,26 @@ int ObExprGeneratorImpl::visit(ObCaseOpRawExpr& expr)
...
@@ -1306,14 +1307,26 @@ int ObExprGeneratorImpl::visit(ObCaseOpRawExpr& expr)
}
else
if
(
expr
.
has_flag
(
IS_COLUMNLIZED
))
{
}
else
if
(
expr
.
has_flag
(
IS_COLUMNLIZED
))
{
int64_t
idx
=
OB_INVALID_INDEX
;
int64_t
idx
=
OB_INVALID_INDEX
;
if
(
OB_FAIL
(
column_idx_provider_
.
get_idx
(
&
expr
,
idx
)))
{
if
(
OB_FAIL
(
column_idx_provider_
.
get_idx
(
&
expr
,
idx
)))
{
LOG_WARN
(
"get index failed"
,
K
(
ret
));
// if an expr has been marked with IS_COLUMNLIZED but get invalid idx,
// then it most likely be a const shared expr and need to calculate again
if
(
ret
==
OB_ENTRY_NOT_EXIST
&&
idx
==
OB_INVALID_INDEX
&&
(
expr
.
has_flag
(
IS_CONST
)
||
expr
.
has_flag
(
IS_CONST_EXPR
)))
{
ret
=
OB_SUCCESS
;
expr
.
clear_flag
(
IS_COLUMNLIZED
);
LOG_TRACE
(
"need to recalculate const expr"
,
K
(
expr
));
}
else
if
(
ret
!=
OB_ENTRY_NOT_EXIST
)
{
LOG_WARN
(
"get index failed"
,
K
(
ret
),
K
(
expr
),
K
(
idx
));
}
}
else
if
(
OB_FAIL
(
item
.
set_column
(
idx
)))
{
}
else
if
(
OB_FAIL
(
item
.
set_column
(
idx
)))
{
LOG_WARN
(
"failed to set column"
,
K
(
ret
),
K
(
expr
));
LOG_WARN
(
"failed to set column"
,
K
(
ret
),
K
(
expr
));
}
else
if
(
OB_FAIL
(
sql_expr_
->
add_expr_item
(
item
,
&
expr
)))
{
}
else
if
(
OB_FAIL
(
sql_expr_
->
add_expr_item
(
item
,
&
expr
)))
{
LOG_WARN
(
"failed to add expr item"
,
K
(
ret
));
LOG_WARN
(
"failed to add expr item"
,
K
(
ret
));
}
else
{
need_calc
=
false
;
}
}
}
else
{
}
ObExprOperator
*
op
=
NULL
;
if
(
OB_SUCC
(
ret
)
&&
need_calc
)
{
ObExprOperator
*
op
=
NULL
;
if
(
OB_FAIL
(
factory_
.
alloc
(
expr
.
get_expr_type
(),
op
)))
{
if
(
OB_FAIL
(
factory_
.
alloc
(
expr
.
get_expr_type
(),
op
)))
{
LOG_WARN
(
"fail to alloc expr_op"
,
K
(
ret
));
LOG_WARN
(
"fail to alloc expr_op"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
NULL
==
op
))
{
}
else
if
(
OB_UNLIKELY
(
NULL
==
op
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录