Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cce9f262
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cce9f262
编写于
7月 04, 2022
作者:
G
Ganlin Zhao
提交者:
GitHub
7月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14507 from taosdata/fix/TD-16948
refactor(query): remove redundant param check in function execution context
上级
833fbca9
600e9928
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
22 deletion
+0
-22
source/libs/scalar/src/sclfunc.c
source/libs/scalar/src/sclfunc.c
+0
-22
未找到文件。
source/libs/scalar/src/sclfunc.c
浏览文件 @
cce9f262
...
@@ -360,9 +360,6 @@ static void trtrim(char *input, char *output, int32_t type, int32_t charLen) {
...
@@ -360,9 +360,6 @@ static void trtrim(char *input, char *output, int32_t type, int32_t charLen) {
static
int32_t
doLengthFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
,
_len_fn
lenFn
)
{
static
int32_t
doLengthFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
,
_len_fn
lenFn
)
{
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
if
(
inputNum
!=
1
||
!
IS_VAR_DATA_TYPE
(
type
))
{
return
TSDB_CODE_FAILED
;
}
SColumnInfoData
*
pInputData
=
pInput
->
columnData
;
SColumnInfoData
*
pInputData
=
pInput
->
columnData
;
SColumnInfoData
*
pOutputData
=
pOutput
->
columnData
;
SColumnInfoData
*
pOutputData
=
pOutput
->
columnData
;
...
@@ -586,9 +583,6 @@ DONE:
...
@@ -586,9 +583,6 @@ DONE:
static
int32_t
doCaseConvFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
,
_conv_fn
convFn
)
{
static
int32_t
doCaseConvFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
,
_conv_fn
convFn
)
{
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
if
(
inputNum
!=
1
||
!
IS_VAR_DATA_TYPE
(
type
))
{
return
TSDB_CODE_FAILED
;
}
SColumnInfoData
*
pInputData
=
pInput
->
columnData
;
SColumnInfoData
*
pInputData
=
pInput
->
columnData
;
SColumnInfoData
*
pOutputData
=
pOutput
->
columnData
;
SColumnInfoData
*
pOutputData
=
pOutput
->
columnData
;
...
@@ -628,9 +622,6 @@ static int32_t doCaseConvFunction(SScalarParam *pInput, int32_t inputNum, SScala
...
@@ -628,9 +622,6 @@ static int32_t doCaseConvFunction(SScalarParam *pInput, int32_t inputNum, SScala
static
int32_t
doTrimFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
,
_trim_fn
trimFn
)
{
static
int32_t
doTrimFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
,
_trim_fn
trimFn
)
{
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
if
(
inputNum
!=
1
||
!
IS_VAR_DATA_TYPE
(
type
))
{
return
TSDB_CODE_FAILED
;
}
SColumnInfoData
*
pInputData
=
pInput
->
columnData
;
SColumnInfoData
*
pInputData
=
pInput
->
columnData
;
SColumnInfoData
*
pOutputData
=
pOutput
->
columnData
;
SColumnInfoData
*
pOutputData
=
pOutput
->
columnData
;
...
@@ -664,16 +655,10 @@ static int32_t doTrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarPar
...
@@ -664,16 +655,10 @@ static int32_t doTrimFunction(SScalarParam *pInput, int32_t inputNum, SScalarPar
int32_t
substrFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
)
{
int32_t
substrFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
)
{
int32_t
subPos
=
0
;
int32_t
subPos
=
0
;
GET_TYPED_DATA
(
subPos
,
int32_t
,
GET_PARAM_TYPE
(
&
pInput
[
1
]),
pInput
[
1
].
columnData
->
pData
);
GET_TYPED_DATA
(
subPos
,
int32_t
,
GET_PARAM_TYPE
(
&
pInput
[
1
]),
pInput
[
1
].
columnData
->
pData
);
if
(
subPos
==
0
)
{
//subPos needs to be positive or negative values;
return
TSDB_CODE_FAILED
;
}
int32_t
subLen
=
INT16_MAX
;
int32_t
subLen
=
INT16_MAX
;
if
(
inputNum
==
3
)
{
if
(
inputNum
==
3
)
{
GET_TYPED_DATA
(
subLen
,
int32_t
,
GET_PARAM_TYPE
(
&
pInput
[
2
]),
pInput
[
2
].
columnData
->
pData
);
GET_TYPED_DATA
(
subLen
,
int32_t
,
GET_PARAM_TYPE
(
&
pInput
[
2
]),
pInput
[
2
].
columnData
->
pData
);
if
(
subLen
<
0
||
subLen
>
INT16_MAX
)
{
//subLen cannot be negative
return
TSDB_CODE_FAILED
;
}
subLen
=
(
GET_PARAM_TYPE
(
pInput
)
==
TSDB_DATA_TYPE_VARCHAR
)
?
subLen
:
subLen
*
TSDB_NCHAR_SIZE
;
subLen
=
(
GET_PARAM_TYPE
(
pInput
)
==
TSDB_DATA_TYPE_VARCHAR
)
?
subLen
:
subLen
*
TSDB_NCHAR_SIZE
;
}
}
...
@@ -1149,13 +1134,6 @@ int32_t toUnixtimestampFunction(SScalarParam *pInput, int32_t inputNum, SScalarP
...
@@ -1149,13 +1134,6 @@ int32_t toUnixtimestampFunction(SScalarParam *pInput, int32_t inputNum, SScalarP
int32_t
toJsonFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
)
{
int32_t
toJsonFunction
(
SScalarParam
*
pInput
,
int32_t
inputNum
,
SScalarParam
*
pOutput
)
{
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
int32_t
type
=
GET_PARAM_TYPE
(
pInput
);
if
(
type
!=
TSDB_DATA_TYPE_BINARY
&&
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
return
TSDB_CODE_FAILED
;
}
if
(
inputNum
!=
1
)
{
return
TSDB_CODE_FAILED
;
}
char
tmp
[
TSDB_MAX_JSON_TAG_LEN
]
=
{
0
};
char
tmp
[
TSDB_MAX_JSON_TAG_LEN
]
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
pInput
[
0
].
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pInput
[
0
].
numOfRows
;
++
i
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录