Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
94ba0a39
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看板
提交
94ba0a39
编写于
7月 12, 2021
作者:
O
obdev
提交者:
wangzelin.wzl
7月 12, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cherry-pick bugfix to opensource
上级
e4739239
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
59 addition
and
10 deletion
+59
-10
deps/oblib/src/lib/number/ob_number_v2.cpp
deps/oblib/src/lib/number/ob_number_v2.cpp
+33
-1
deps/oblib/src/lib/number/ob_number_v2.h
deps/oblib/src/lib/number/ob_number_v2.h
+3
-0
src/sql/code_generator/ob_expr_generator_impl.cpp
src/sql/code_generator/ob_expr_generator_impl.cpp
+10
-4
src/sql/code_generator/ob_static_engine_cg.cpp
src/sql/code_generator/ob_static_engine_cg.cpp
+4
-0
src/sql/dtl/ob_dtl_rpc_channel.cpp
src/sql/dtl/ob_dtl_rpc_channel.cpp
+7
-3
src/sql/engine/aggregate/ob_distinct_op.cpp
src/sql/engine/aggregate/ob_distinct_op.cpp
+1
-1
src/sql/engine/aggregate/ob_distinct_op.h
src/sql/engine/aggregate/ob_distinct_op.h
+1
-1
未找到文件。
deps/oblib/src/lib/number/ob_number_v2.cpp
浏览文件 @
94ba0a39
...
@@ -344,7 +344,9 @@ int ObNumber::from_sci_(const char* str, const int64_t length, IAllocator& alloc
...
@@ -344,7 +344,9 @@ int ObNumber::from_sci_(const char* str, const int64_t length, IAllocator& alloc
}
}
}
}
if
(
OB_SUCC
(
ret
)
&&
(
has_digit
||
0
<
i_nth
)
&&
(
'e'
==
cur
||
'E'
==
cur
))
{
if
(
OB_SUCC
(
ret
)
&&
(
has_digit
||
0
<
i_nth
)
&&
(
'e'
==
cur
||
'E'
==
cur
)
&&
is_valid_sci_tail_
(
str
,
length
,
i
))
{
LOG_DEBUG
(
"ObNumber from sci"
,
LOG_DEBUG
(
"ObNumber from sci"
,
K
(
ret
),
K
(
ret
),
K
(
i
),
K
(
i
),
...
@@ -6629,6 +6631,36 @@ int ObNumber::cast_to_int64(int64_t& value) const
...
@@ -6629,6 +6631,36 @@ int ObNumber::cast_to_int64(int64_t& value) const
return
ret
;
return
ret
;
}
}
/**
* check whether a sci format string has a valid exponent part
* valid : 1.8E-1/1.8E1 invalid : 1.8E, 1.8Ea, 1.8E-a
* @param str string need to parse
* @param length length of str
* @param e_pos index of 'E'
*/
bool
ObNumber
::
is_valid_sci_tail_
(
const
char
*
str
,
const
int64_t
length
,
const
int64_t
e_pos
)
{
bool
res
=
false
;
if
(
e_pos
==
length
-
1
)
{
//like 1.8e, false
}
else
if
(
e_pos
<
length
-
1
)
{
if
(
'+'
==
str
[
e_pos
+
1
]
||
'-'
==
str
[
e_pos
+
1
])
{
if
(
e_pos
<
length
-
2
&&
str
[
e_pos
+
2
]
>=
'0'
&&
str
[
e_pos
+
2
]
<=
'9'
)
{
res
=
true
;
}
else
{
//like 1.8e+, false
}
}
else
if
(
str
[
e_pos
+
1
]
>=
'0'
&&
str
[
e_pos
+
1
]
<=
'9'
)
{
res
=
true
;
}
else
{
//like 1.8ea, false
}
}
return
res
;
}
void
ObNumber
::
set_one
()
void
ObNumber
::
set_one
()
{
{
if
(
OB_ISNULL
(
digits_
))
{
if
(
OB_ISNULL
(
digits_
))
{
...
...
deps/oblib/src/lib/number/ob_number_v2.h
浏览文件 @
94ba0a39
...
@@ -542,6 +542,9 @@ protected:
...
@@ -542,6 +542,9 @@ protected:
inline
static
bool
is_lt_1_
(
const
Desc
d
)
__attribute__
((
always_inline
));
inline
static
bool
is_lt_1_
(
const
Desc
d
)
__attribute__
((
always_inline
));
inline
static
int
exp_check_
(
const
ObNumber
::
Desc
&
desc
,
const
bool
is_oracle_mode
=
false
)
inline
static
int
exp_check_
(
const
ObNumber
::
Desc
&
desc
,
const
bool
is_oracle_mode
=
false
)
__attribute__
((
always_inline
));
__attribute__
((
always_inline
));
inline
static
bool
is_valid_sci_tail_
(
const
char
*
str
,
const
int64_t
length
,
const
int64_t
e_pos
)
__attribute__
((
always_inline
));
public:
public:
bool
is_int64
()
const
;
bool
is_int64
()
const
;
...
...
src/sql/code_generator/ob_expr_generator_impl.cpp
浏览文件 @
94ba0a39
...
@@ -690,7 +690,9 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
...
@@ -690,7 +690,9 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
bool
param_all_is_ext
=
true
;
bool
param_all_is_ext
=
true
;
bool
param_all_same_cs_level
=
true
;
bool
param_all_same_cs_level
=
true
;
for
(
int64_t
j
=
0
;
OB_SUCC
(
ret
)
&&
j
<
in_op
->
get_row_dimension
();
++
j
)
{
for
(
int64_t
j
=
0
;
OB_SUCC
(
ret
)
&&
j
<
in_op
->
get_row_dimension
();
++
j
)
{
param_all_const
&=
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
has_const_or_const_expr_flag
();
param_all_const
&=
(
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
has_const_or_const_expr_flag
()
&&
!
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
has_flag
(
IS_EXEC_PARAM
));
ObObjType
first_obj_type
=
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
get_data_type
();
ObObjType
first_obj_type
=
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
get_data_type
();
ObObjType
cur_obj_type
=
ObMaxType
;
ObObjType
cur_obj_type
=
ObMaxType
;
ObCollationType
first_obj_cs_type
=
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
get_collation_type
();
ObCollationType
first_obj_cs_type
=
param1
->
get_param_expr
(
0
)
->
get_param_expr
(
j
)
->
get_collation_type
();
...
@@ -707,7 +709,9 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
...
@@ -707,7 +709,9 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
first_obj_cs_type
=
cur_obj_cs_type
;
first_obj_cs_type
=
cur_obj_cs_type
;
}
}
if
(
ObNullType
!=
first_obj_type
&&
ObNullType
!=
cur_obj_type
)
{
if
(
ObNullType
!=
first_obj_type
&&
ObNullType
!=
cur_obj_type
)
{
param_all_const
&=
param1
->
get_param_expr
(
i
)
->
get_param_expr
(
j
)
->
has_const_or_const_expr_flag
();
param_all_const
&=
(
param1
->
get_param_expr
(
i
)
->
get_param_expr
(
j
)
->
has_const_or_const_expr_flag
()
&&
!
param1
->
get_param_expr
(
i
)
->
get_param_expr
(
j
)
->
has_flag
(
IS_EXEC_PARAM
));
param_all_same_type
&=
(
first_obj_type
==
cur_obj_type
);
param_all_same_type
&=
(
first_obj_type
==
cur_obj_type
);
param_all_same_cs_type
&=
(
first_obj_cs_type
==
cur_obj_cs_type
);
param_all_same_cs_type
&=
(
first_obj_cs_type
==
cur_obj_cs_type
);
param_all_same_cs_level
&=
(
first_obj_cs_level
==
cur_obj_cs_level
);
param_all_same_cs_level
&=
(
first_obj_cs_level
==
cur_obj_cs_level
);
...
@@ -738,7 +742,8 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
...
@@ -738,7 +742,8 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
}
}
}
}
if
(
OB_SUCC
(
ret
))
{
if
(
OB_SUCC
(
ret
))
{
bool
param_all_const
=
param1
->
get_param_expr
(
0
)
->
has_const_or_const_expr_flag
();
bool
param_all_const
=
(
param1
->
get_param_expr
(
0
)
->
has_const_or_const_expr_flag
()
&&
!
param1
->
get_param_expr
(
0
)
->
has_flag
(
IS_EXEC_PARAM
));
bool
param_all_same_type
=
true
;
bool
param_all_same_type
=
true
;
bool
param_all_same_cs_type
=
true
;
bool
param_all_same_cs_type
=
true
;
bool
param_all_is_ext
=
true
;
bool
param_all_is_ext
=
true
;
...
@@ -759,7 +764,8 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
...
@@ -759,7 +764,8 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr& expr, ObExprInOrNotIn
first_obj_cs_type
=
cur_obj_cs_type
;
first_obj_cs_type
=
cur_obj_cs_type
;
}
}
if
(
ObNullType
!=
first_obj_type
&&
ObNullType
!=
cur_obj_type
)
{
if
(
ObNullType
!=
first_obj_type
&&
ObNullType
!=
cur_obj_type
)
{
param_all_const
&=
param1
->
get_param_expr
(
i
)
->
has_const_or_const_expr_flag
();
param_all_const
&=
(
param1
->
get_param_expr
(
i
)
->
has_const_or_const_expr_flag
()
&&
!
param1
->
get_param_expr
(
i
)
->
has_flag
(
IS_EXEC_PARAM
));
param_all_same_type
&=
(
first_obj_type
==
cur_obj_type
);
param_all_same_type
&=
(
first_obj_type
==
cur_obj_type
);
param_all_same_cs_type
&=
(
first_obj_cs_type
==
cur_obj_cs_type
);
param_all_same_cs_type
&=
(
first_obj_cs_type
==
cur_obj_cs_type
);
param_all_same_cs_level
&=
(
first_obj_cs_level
==
cur_obj_cs_level
);
param_all_same_cs_level
&=
(
first_obj_cs_level
==
cur_obj_cs_level
);
...
...
src/sql/code_generator/ob_static_engine_cg.cpp
浏览文件 @
94ba0a39
...
@@ -628,6 +628,8 @@ int ObStaticEngineCG::generate_spec(ObLogDistinct& op, ObMergeDistinctSpec& spec
...
@@ -628,6 +628,8 @@ int ObStaticEngineCG::generate_spec(ObLogDistinct& op, ObMergeDistinctSpec& spec
LOG_WARN
(
"merge distinct has no block mode"
,
K
(
op
.
get_algo
()),
K
(
op
.
get_block_mode
()),
K
(
ret
));
LOG_WARN
(
"merge distinct has no block mode"
,
K
(
op
.
get_algo
()),
K
(
op
.
get_block_mode
()),
K
(
ret
));
}
else
if
(
OB_FAIL
(
spec
.
cmp_funcs_
.
init
(
op
.
get_distinct_exprs
().
count
())))
{
}
else
if
(
OB_FAIL
(
spec
.
cmp_funcs_
.
init
(
op
.
get_distinct_exprs
().
count
())))
{
LOG_WARN
(
"failed to init sort functions"
,
K
(
ret
));
LOG_WARN
(
"failed to init sort functions"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
spec
.
distinct_exprs_
.
init
(
op
.
get_distinct_exprs
().
count
())))
{
LOG_WARN
(
"failed to init distinct exprs"
,
K
(
ret
));
}
else
{
}
else
{
ObExpr
*
expr
=
nullptr
;
ObExpr
*
expr
=
nullptr
;
ARRAY_FOREACH
(
op
.
get_distinct_exprs
(),
i
)
ARRAY_FOREACH
(
op
.
get_distinct_exprs
(),
i
)
...
@@ -665,6 +667,8 @@ int ObStaticEngineCG::generate_spec(ObLogDistinct& op, ObHashDistinctSpec& spec,
...
@@ -665,6 +667,8 @@ int ObStaticEngineCG::generate_spec(ObLogDistinct& op, ObHashDistinctSpec& spec,
LOG_WARN
(
"failed to init sort functions"
,
K
(
ret
));
LOG_WARN
(
"failed to init sort functions"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
spec
.
sort_collations_
.
init
(
op
.
get_distinct_exprs
().
count
())))
{
}
else
if
(
OB_FAIL
(
spec
.
sort_collations_
.
init
(
op
.
get_distinct_exprs
().
count
())))
{
LOG_WARN
(
"failed to init sort functions"
,
K
(
ret
));
LOG_WARN
(
"failed to init sort functions"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
spec
.
distinct_exprs_
.
init
(
op
.
get_distinct_exprs
().
count
())))
{
LOG_WARN
(
"failed to init distinct exprs"
,
K
(
ret
));
}
else
{
}
else
{
ObExpr
*
expr
=
nullptr
;
ObExpr
*
expr
=
nullptr
;
int64_t
dist_cnt
=
0
;
int64_t
dist_cnt
=
0
;
...
...
src/sql/dtl/ob_dtl_rpc_channel.cpp
浏览文件 @
94ba0a39
...
@@ -80,8 +80,10 @@ void ObDtlRpcChannel::SendBCMsgCB::on_invalid()
...
@@ -80,8 +80,10 @@ void ObDtlRpcChannel::SendBCMsgCB::on_invalid()
LOG_WARN
(
"SendBCMsgCB invalid, check object serialization impl or oom"
,
K_
(
trace_id
));
LOG_WARN
(
"SendBCMsgCB invalid, check object serialization impl or oom"
,
K_
(
trace_id
));
AsyncCB
::
on_invalid
();
AsyncCB
::
on_invalid
();
ObIArray
<
ObDtlRpcDataResponse
>&
resps
=
result_
.
resps_
;
ObIArray
<
ObDtlRpcDataResponse
>&
resps
=
result_
.
resps_
;
for
(
int64_t
i
=
0
;
i
<
resps
.
count
()
&&
i
<
responses_
.
count
();
++
i
)
{
for
(
int64_t
i
=
0
;
i
<
responses_
.
count
();
++
i
)
{
int
ret
=
responses_
.
at
(
i
)
->
on_finish
(
resps
.
at
(
i
).
is_block_
,
OB_RPC_PACKET_INVALID
);
int
ret_code
=
(
OB_SUCCESS
!=
rcode_
.
rcode_
)
?
rcode_
.
rcode_
:
(
i
<
resps
.
count
()
?
resps
.
at
(
i
).
recode_
:
OB_RPC_PACKET_INVALID
);
int
ret
=
responses_
.
at
(
i
)
->
on_finish
(
false
,
ret_code
);
if
(
OB_FAIL
(
ret
))
{
if
(
OB_FAIL
(
ret
))
{
LOG_WARN
(
"set finish failed"
,
K
(
ret
),
K
(
resps
.
count
()),
K
(
responses_
.
count
()),
K
(
trace_id_
));
LOG_WARN
(
"set finish failed"
,
K
(
ret
),
K
(
resps
.
count
()),
K
(
responses_
.
count
()),
K
(
trace_id_
));
}
}
...
@@ -93,7 +95,9 @@ void ObDtlRpcChannel::SendBCMsgCB::on_timeout()
...
@@ -93,7 +95,9 @@ void ObDtlRpcChannel::SendBCMsgCB::on_timeout()
LOG_WARN
(
"SendBCMsgCB timeout, if negative timeout, check peer cpu load, network packet drop rate"
,
K_
(
trace_id
));
LOG_WARN
(
"SendBCMsgCB timeout, if negative timeout, check peer cpu load, network packet drop rate"
,
K_
(
trace_id
));
ObIArray
<
ObDtlRpcDataResponse
>&
resps
=
result_
.
resps_
;
ObIArray
<
ObDtlRpcDataResponse
>&
resps
=
result_
.
resps_
;
for
(
int64_t
i
=
0
;
i
<
resps
.
count
()
&&
i
<
responses_
.
count
();
++
i
)
{
for
(
int64_t
i
=
0
;
i
<
resps
.
count
()
&&
i
<
responses_
.
count
();
++
i
)
{
int
ret
=
responses_
.
at
(
i
)
->
on_finish
(
resps
.
at
(
i
).
is_block_
,
OB_TIMEOUT
);
int
ret_code
=
(
OB_SUCCESS
!=
rcode_
.
rcode_
)
?
rcode_
.
rcode_
:
(
i
<
resps
.
count
()
?
resps
.
at
(
i
).
recode_
:
OB_TIMEOUT
);
int
ret
=
responses_
.
at
(
i
)
->
on_finish
(
false
,
ret_code
);
if
(
OB_FAIL
(
ret
))
{
if
(
OB_FAIL
(
ret
))
{
LOG_WARN
(
"set finish failed"
,
K
(
ret
),
K
(
resps
.
count
()),
K
(
responses_
.
count
()),
K
(
trace_id_
));
LOG_WARN
(
"set finish failed"
,
K
(
ret
),
K
(
resps
.
count
()),
K
(
responses_
.
count
()),
K
(
trace_id_
));
}
}
...
...
src/sql/engine/aggregate/ob_distinct_op.cpp
浏览文件 @
94ba0a39
...
@@ -23,7 +23,7 @@ using namespace common;
...
@@ -23,7 +23,7 @@ using namespace common;
namespace
sql
{
namespace
sql
{
ObDistinctSpec
::
ObDistinctSpec
(
ObIAllocator
&
alloc
,
const
ObPhyOperatorType
type
)
ObDistinctSpec
::
ObDistinctSpec
(
ObIAllocator
&
alloc
,
const
ObPhyOperatorType
type
)
:
ObOpSpec
(
alloc
,
type
),
distinct_exprs_
(),
cmp_funcs_
(
alloc
),
is_block_mode_
(
false
)
:
ObOpSpec
(
alloc
,
type
),
distinct_exprs_
(
alloc
),
cmp_funcs_
(
alloc
),
is_block_mode_
(
false
)
{}
{}
OB_SERIALIZE_MEMBER
((
ObDistinctSpec
,
ObOpSpec
),
distinct_exprs_
,
cmp_funcs_
,
is_block_mode_
);
OB_SERIALIZE_MEMBER
((
ObDistinctSpec
,
ObOpSpec
),
distinct_exprs_
,
cmp_funcs_
,
is_block_mode_
);
...
...
src/sql/engine/aggregate/ob_distinct_op.h
浏览文件 @
94ba0a39
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
INHERIT_TO_STRING_KV
(
"op_spec"
,
ObOpSpec
,
K_
(
distinct_exprs
),
K_
(
is_block_mode
),
K_
(
cmp_funcs
));
INHERIT_TO_STRING_KV
(
"op_spec"
,
ObOpSpec
,
K_
(
distinct_exprs
),
K_
(
is_block_mode
),
K_
(
cmp_funcs
));
// data members
// data members
common
::
Ob
SEArray
<
ObExpr
*
,
4
>
distinct_exprs_
;
common
::
Ob
FixedArray
<
ObExpr
*
,
common
::
ObIAllocator
>
distinct_exprs_
;
common
::
ObCmpFuncs
cmp_funcs_
;
common
::
ObCmpFuncs
cmp_funcs_
;
bool
is_block_mode_
;
bool
is_block_mode_
;
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录