Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
0fac1dd0
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,发现更多精彩内容 >>
提交
0fac1dd0
编写于
12月 01, 2021
作者:
S
st0
提交者:
LINGuanRen
12月 01, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix use GCONF.enable_static_engine_for_query bug
上级
50211ed1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
35 deletion
+12
-35
src/sql/engine/expr/ob_expr_operator.cpp
src/sql/engine/expr/ob_expr_operator.cpp
+9
-4
src/sql/engine/expr/ob_expr_operator.h
src/sql/engine/expr/ob_expr_operator.h
+2
-30
src/sql/resolver/expr/ob_raw_expr.cpp
src/sql/resolver/expr/ob_raw_expr.cpp
+1
-1
未找到文件。
src/sql/engine/expr/ob_expr_operator.cpp
浏览文件 @
0fac1dd0
...
...
@@ -3014,15 +3014,20 @@ int ObVectorExprOperator::calc_result_type2_(
{
int
ret
=
OB_SUCCESS
;
ObExprResType
cmp_type
;
if
(
OB_SUCC
(
calc_cmp_type2
(
cmp_type
,
type1
,
type2
,
type_ctx
.
get_coll_type
())))
{
if
(
OB_ISNULL
(
type_ctx
.
get_session
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"session is null"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
calc_cmp_type2
(
cmp_type
,
type1
,
type2
,
type_ctx
.
get_coll_type
())))
{
LOG_WARN
(
"calc cmp type2 failed"
,
K
(
ret
));
}
else
{
type
.
set_int
();
// not tinyint, compatiable with MySQL
type
.
set_calc_collation
(
cmp_type
);
type
.
set_calc_type
(
cmp_type
.
get_calc_type
());
ObExprOperator
::
calc_result_flag2
(
type
,
type1
,
type2
);
if
(
GCONF
.
enable_static_engine_for_query
())
{
obj_cmp_func
func_ptr
=
NULL
;
bool
need_no_cast
=
ObRelationalExprOperator
::
can_cmp_without_cast
(
type1
,
type2
,
CO_EQ
,
func_ptr
);
if
(
type_ctx
.
get_session
()
->
use_static_typing_engine
())
{
bool
need_no_cast
=
ObRelationalExprOperator
::
can_cmp_without_cast
(
type1
,
type2
,
CO_EQ
,
*
type_ctx
.
get_session
()
);
type1
.
set_calc_type
(
need_no_cast
?
type1
.
get_type
()
:
cmp_type
.
get_calc_type
());
type2
.
set_calc_type
(
need_no_cast
?
type2
.
get_type
()
:
cmp_type
.
get_calc_type
());
if
(
ob_is_string_type
(
cmp_type
.
get_calc_type
()))
{
...
...
src/sql/engine/expr/ob_expr_operator.h
浏览文件 @
0fac1dd0
...
...
@@ -1000,33 +1000,8 @@ public:
return
ret
;
}
static
int
get_equal_meta
(
common
::
ObObjMeta
&
meta
,
const
common
::
ObObjMeta
&
meta1
,
const
common
::
ObObjMeta
&
meta2
);
OB_INLINE
static
bool
can_cmp_without_cast
(
const
ObExprResType
&
type1
,
const
ObExprResType
&
type2
,
common
::
ObCmpOp
cmp_op
,
common
::
obj_cmp_func
&
cmp_func
)
{
bool
need_no_cast
=
false
;
// Special processing shows that compare is called (for example: c1> c2),
// at this time enum/set should be converted to string processing.
// Internal comparison (order by), enum/set does not need to be converted.
if
(
GCONF
.
enable_static_engine_for_query
())
{
if
(
common
::
ObDatumFuncs
::
is_string_type
(
type1
.
get_type
())
&&
common
::
ObDatumFuncs
::
is_string_type
(
type2
.
get_type
()))
{
need_no_cast
=
common
::
ObCharset
::
charset_type_by_coll
(
type1
.
get_collation_type
())
==
common
::
ObCharset
::
charset_type_by_coll
(
type2
.
get_collation_type
());
}
else
{
auto
func_ptr
=
ObExprCmpFuncsHelper
::
get_eval_expr_cmp_func
(
type1
.
get_type
(),
type2
.
get_type
(),
cmp_op
,
lib
::
is_oracle_mode
(),
common
::
CS_TYPE_MAX
);
need_no_cast
=
(
func_ptr
!=
nullptr
);
}
}
else
if
(
common
::
ob_is_enum_or_set_type
(
type1
.
get_type
())
&&
common
::
ob_is_enum_or_set_type
(
type2
.
get_type
()))
{
need_no_cast
=
false
;
}
else
{
need_no_cast
=
common
::
ObObjCmpFuncs
::
can_cmp_without_cast
(
type1
,
type2
,
cmp_op
,
cmp_func
);
}
return
need_no_cast
;
}
static
bool
can_cmp_without_cast
(
const
ObExprResType
&
type1
,
const
ObExprResType
&
type2
,
common
::
ObCmpOp
cmp_op
,
const
ObSQLSessionInfo
&
session
);
protected:
static
bool
is_int_cmp_const_str
(
const
ObExprResType
*
type1
,
const
ObExprResType
*
type2
,
common
::
ObObjType
&
cmp_type
);
...
...
@@ -1116,9 +1091,6 @@ protected:
return
common
::
ObObjCmpFuncs
::
compare
(
result
,
obj1
,
obj2
,
cmp_ctx
,
cmp_op
,
cmp_func
);
}
static
bool
can_cmp_without_cast
(
const
ObExprResType
&
type1
,
const
ObExprResType
&
type2
,
common
::
ObCmpOp
cmp_op
,
const
ObSQLSessionInfo
&
session
);
protected:
// only use for comparison with 2 operands(calc_result2)
// if cmp_op_func2_ is not NULL, that means we can compare the 2 objs directly without any casts
...
...
src/sql/resolver/expr/ob_raw_expr.cpp
浏览文件 @
0fac1dd0
...
...
@@ -1910,7 +1910,7 @@ int ObOpRawExpr::get_subquery_comparison_name(
void
ObOpRawExpr
::
set_expr_type
(
ObItemType
type
)
{
type_
=
type
;
if
((
T_OP_IN
==
type_
||
T_OP_NOT_IN
==
type_
)
&&
GCONF
.
enable_static_engine_for_query
()
)
{
if
((
T_OP_IN
==
type_
||
T_OP_NOT_IN
==
type_
))
{
set_deduce_type_adding_implicit_cast
(
false
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录