Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
b1581e36
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,发现更多精彩内容 >>
提交
b1581e36
编写于
9月 17, 2021
作者:
B
br0
提交者:
wangzelin.wzl
9月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[WhiteScan] Fix some white scan errors
上级
875865e0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
57 addition
and
59 deletion
+57
-59
src/sql/engine/expr/ob_expr_div.cpp
src/sql/engine/expr/ob_expr_div.cpp
+0
-1
src/sql/engine/expr/ob_expr_func_part_hash.cpp
src/sql/engine/expr/ob_expr_func_part_hash.cpp
+11
-8
src/sql/engine/expr/ob_expr_in.h
src/sql/engine/expr/ob_expr_in.h
+1
-0
src/sql/engine/expr/ob_expr_least.cpp
src/sql/engine/expr/ob_expr_least.cpp
+45
-50
未找到文件。
src/sql/engine/expr/ob_expr_div.cpp
浏览文件 @
b1581e36
...
...
@@ -403,7 +403,6 @@ int ObExprDiv::div_interval(
res
.
set_scale
(
ObAccuracy
::
MAX_ACCURACY2
[
ORACLE_MODE
][
res
.
get_type
()].
get_scale
());
UNUSED
(
calc_scale
);
return
ret
;
return
ret
;
}
const
ObScale
ObExprDiv
::
DIV_CALC_SCALE
=
9
;
...
...
src/sql/engine/expr/ob_expr_func_part_hash.cpp
浏览文件 @
b1581e36
...
...
@@ -574,15 +574,18 @@ int ObExprFuncPartHash::calc_oracle_vt_part_id(ObTaskExecutorCtx& task_exec_ctx,
}
else
{
ObString
ip
=
objs_stack
[
0
].
get_string
();
number
::
ObNumber
port_num
;
objs_stack
[
1
].
get_number
(
port_num
);
int32_t
port
=
atoi
(
port_num
.
format
());
ObAddr
addr
;
addr
.
set_ip_addr
(
ip
,
port
);
int64_t
part_id
=
OB_INVALID_ID
;
if
(
OB_FAIL
(
task_exec_ctx
.
calc_virtual_partition_id
(
table_id
,
addr
,
part_id
)))
{
LOG_WARN
(
"calculate virtual table partition id failed"
,
K
(
table_id
),
K
(
addr
));
if
(
OB_FAIL
(
objs_stack
[
1
].
get_number
(
port_num
)))
{
LOG_WARN
(
"Get port_number failed."
,
K
(
ret
));
}
else
{
result
.
set_int
(
part_id
);
int32_t
port
=
atoi
(
port_num
.
format
());
ObAddr
addr
;
addr
.
set_ip_addr
(
ip
,
port
);
int64_t
part_id
=
OB_INVALID_ID
;
if
(
OB_FAIL
(
task_exec_ctx
.
calc_virtual_partition_id
(
table_id
,
addr
,
part_id
)))
{
LOG_WARN
(
"calculate virtual table partition id failed"
,
K
(
table_id
),
K
(
addr
));
}
else
{
result
.
set_int
(
part_id
);
}
}
}
return
ret
;
...
...
src/sql/engine/expr/ob_expr_in.h
浏览文件 @
b1581e36
...
...
@@ -182,6 +182,7 @@ class ObExprInOrNotIn : public ObVectorExprOperator {
public:
ObExprInCtx
()
:
ObExprOperatorCtx
(),
row_dimension_
(
-
1
),
right_has_null
(
false
),
hash_func_buff_
(
NULL
),
funcs_ptr_set
(
false
),
...
...
src/sql/engine/expr/ob_expr_least.cpp
浏览文件 @
b1581e36
...
...
@@ -45,61 +45,56 @@ int ObExprBaseLeastGreatest::calc_result_typeN_oracle(
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"types is null or param_num is wrong"
,
K
(
types
),
K
(
param_num
),
K
(
ret
));
}
else
{
if
(
OB_ISNULL
(
types
)
||
OB_UNLIKELY
(
param_num
<
1
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"types is null or param_num is wrong"
,
K
(
types
),
K
(
param_num
),
K
(
ret
));
ObExprResType
&
first_type
=
types
[
0
];
type
=
first_type
;
if
(
ObIntTC
==
first_type
.
get_type_class
()
||
ObUIntTC
==
first_type
.
get_type_class
()
||
ObNumberTC
==
first_type
.
get_type_class
())
{
type
.
set_type
(
ObNumberType
);
type
.
set_calc_type
(
ObNumberType
);
type
.
set_scale
(
ORA_NUMBER_SCALE_UNKNOWN_YET
);
type
.
set_precision
(
PRECISION_UNKNOWN_YET
);
}
else
if
(
ObLongTextType
==
type
.
get_type
())
{
ret
=
OB_ERR_INVALID_TYPE_FOR_OP
;
LOG_WARN
(
"lob type parameter not expected"
,
K
(
ret
));
}
else
{
ObExprResType
&
first_type
=
types
[
0
];
type
=
first_type
;
if
(
ObIntTC
==
first_type
.
get_type_class
()
||
ObUIntTC
==
first_type
.
get_type_class
()
||
ObNumberTC
==
first_type
.
get_type_class
())
{
type
.
set_type
(
ObNumberType
);
type
.
set_calc_type
(
ObNumberType
);
type
.
set_scale
(
ORA_NUMBER_SCALE_UNKNOWN_YET
);
type
.
set_precision
(
PRECISION_UNKNOWN_YET
);
}
else
if
(
ObLongTextType
==
type
.
get_type
())
{
ret
=
OB_ERR_INVALID_TYPE_FOR_OP
;
LOG_WARN
(
"lob type parameter not expected"
,
K
(
ret
));
}
else
{
type
.
set_type
(
first_type
.
get_type
());
type
.
set_calc_type
(
first_type
.
get_type
());
}
if
(
ObStringTC
==
type
.
get_type_class
())
{
int64_t
max_length
=
0
;
int64_t
all_char
=
0
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
param_num
;
i
++
)
{
int64_t
item_length
=
0
;
if
(
ObStringTC
==
types
[
i
].
get_type_class
()
||
ObLongTextType
==
types
[
i
].
get_type
())
{
item_length
=
types
[
i
].
get_length
();
if
(
LS_CHAR
==
types
[
i
].
get_length_semantics
())
{
item_length
=
item_length
*
4
;
all_char
++
;
}
}
else
if
(
ObNumberTC
==
types
[
i
].
get_type_class
()
||
ObIntTC
==
types
[
i
].
get_type_class
()
||
ObUIntTC
==
types
[
i
].
get_type_class
())
{
item_length
=
number
::
ObNumber
::
MAX_PRECISION
-
number
::
ObNumber
::
MIN_SCALE
;
}
else
if
(
ObOTimestampTC
==
types
[
i
].
get_type_class
()
||
ObFloatTC
==
types
[
i
].
get_type_class
()
||
ObDoubleTC
==
types
[
i
].
get_type_class
()
||
ObNullTC
==
types
[
i
].
get_type_class
())
{
item_length
=
40
;
}
else
if
(
ObDateTimeTC
==
types
[
i
].
get_type_class
())
{
item_length
=
19
;
}
else
{
ret
=
OB_NOT_SUPPORTED
;
LOG_WARN
(
"unsupported type"
,
K
(
ret
),
K
(
types
[
i
]),
K
(
types
[
i
].
get_type_class
()));
}
type
.
set_type
(
first_type
.
get_type
());
type
.
set_calc_type
(
first_type
.
get_type
());
}
if
(
OB_SUCC
(
ret
))
{
max_length
=
MAX
(
max_length
,
item_length
);
if
(
ObStringTC
==
type
.
get_type_class
())
{
int64_t
max_length
=
0
;
int64_t
all_char
=
0
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
param_num
;
i
++
)
{
int64_t
item_length
=
0
;
if
(
ObStringTC
==
types
[
i
].
get_type_class
()
||
ObLongTextType
==
types
[
i
].
get_type
())
{
item_length
=
types
[
i
].
get_length
();
if
(
LS_CHAR
==
types
[
i
].
get_length_semantics
())
{
item_length
=
item_length
*
4
;
all_char
++
;
}
}
else
if
(
ObNumberTC
==
types
[
i
].
get_type_class
()
||
ObIntTC
==
types
[
i
].
get_type_class
()
||
ObUIntTC
==
types
[
i
].
get_type_class
())
{
item_length
=
number
::
ObNumber
::
MAX_PRECISION
-
number
::
ObNumber
::
MIN_SCALE
;
}
else
if
(
ObOTimestampTC
==
types
[
i
].
get_type_class
()
||
ObFloatTC
==
types
[
i
].
get_type_class
()
||
ObDoubleTC
==
types
[
i
].
get_type_class
()
||
ObNullTC
==
types
[
i
].
get_type_class
())
{
item_length
=
40
;
}
else
if
(
ObDateTimeTC
==
types
[
i
].
get_type_class
())
{
item_length
=
19
;
}
else
{
ret
=
OB_NOT_SUPPORTED
;
LOG_WARN
(
"unsupported type"
,
K
(
ret
),
K
(
types
[
i
]),
K
(
types
[
i
].
get_type_class
()));
}
if
(
OB_SUCC
(
ret
))
{
if
(
all_char
==
param_num
)
{
type
.
set_length
(
static_cast
<
ObLength
>
(
max_length
/
4
));
type
.
set_length_semantics
(
LS_CHAR
);
}
else
{
type
.
set_length
(
static_cast
<
ObLength
>
(
max_length
));
}
max_length
=
MAX
(
max_length
,
item_length
);
}
}
if
(
OB_SUCC
(
ret
))
{
if
(
all_char
==
param_num
)
{
type
.
set_length
(
static_cast
<
ObLength
>
(
max_length
/
4
));
type
.
set_length_semantics
(
LS_CHAR
);
}
else
{
type
.
set_length
(
static_cast
<
ObLength
>
(
max_length
));
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录