Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e5c3ff71
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5c3ff71
编写于
10月 11, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: coverity issues
CID: 399950
上级
936c7b62
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
30 deletion
+30
-30
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+2
-2
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+1
-1
source/libs/scalar/src/sclvector.c
source/libs/scalar/src/sclvector.c
+27
-27
未找到文件。
source/common/src/tdataformat.c
浏览文件 @
e5c3ff71
...
@@ -1678,8 +1678,8 @@ int32_t tColDataCopy(SColData *pColDataSrc, SColData *pColDataDest) {
...
@@ -1678,8 +1678,8 @@ int32_t tColDataCopy(SColData *pColDataSrc, SColData *pColDataDest) {
int32_t
size
;
int32_t
size
;
ASSERT
(
pColDataSrc
->
nVal
>
0
);
ASSERT
(
pColDataSrc
->
nVal
>
0
);
ASSERT
(
pColDataDest
->
cid
=
pColDataSrc
->
cid
);
ASSERT
(
pColDataDest
->
cid
=
=
pColDataSrc
->
cid
);
ASSERT
(
pColDataDest
->
type
=
pColDataSrc
->
type
);
ASSERT
(
pColDataDest
->
type
=
=
pColDataSrc
->
type
);
pColDataDest
->
smaOn
=
pColDataSrc
->
smaOn
;
pColDataDest
->
smaOn
=
pColDataSrc
->
smaOn
;
pColDataDest
->
nVal
=
pColDataSrc
->
nVal
;
pColDataDest
->
nVal
=
pColDataSrc
->
nVal
;
...
...
source/libs/scalar/src/filter.c
浏览文件 @
e5c3ff71
...
@@ -1939,7 +1939,7 @@ int32_t fltInitValFieldData(SFilterInfo *info) {
...
@@ -1939,7 +1939,7 @@ int32_t fltInitValFieldData(SFilterInfo *info) {
bytes
=
(
len
+
1
)
*
TSDB_NCHAR_SIZE
+
VARSTR_HEADER_SIZE
;
bytes
=
(
len
+
1
)
*
TSDB_NCHAR_SIZE
+
VARSTR_HEADER_SIZE
;
fi
->
data
=
taosMemoryCalloc
(
1
,
bytes
);
fi
->
data
=
taosMemoryCalloc
(
1
,
bytes
);
}
else
{
}
else
{
if
(
dType
->
type
==
TSDB_DATA_TYPE_VALUE_ARRAY
)
{
//TIME RANGE
if
(
dType
->
type
==
TSDB_DATA_TYPE_VALUE_ARRAY
)
{
//TIME RANGE
/*
/*
fi->data = taosMemoryCalloc(dType->bytes, tDataTypes[type].bytes);
fi->data = taosMemoryCalloc(dType->bytes, tDataTypes[type].bytes);
...
...
source/libs/scalar/src/sclvector.c
浏览文件 @
e5c3ff71
...
@@ -529,24 +529,24 @@ void* ncharTobinary(void *buf){ // todo need to remove , if tobinary
...
@@ -529,24 +529,24 @@ void* ncharTobinary(void *buf){ // todo need to remove , if tobinary
bool
convertJsonValue
(
__compar_fn_t
*
fp
,
int32_t
optr
,
int8_t
typeLeft
,
int8_t
typeRight
,
char
**
pLeftData
,
char
**
pRightData
,
bool
convertJsonValue
(
__compar_fn_t
*
fp
,
int32_t
optr
,
int8_t
typeLeft
,
int8_t
typeRight
,
char
**
pLeftData
,
char
**
pRightData
,
void
*
pLeftOut
,
void
*
pRightOut
,
bool
*
isNull
,
bool
*
freeLeft
,
bool
*
freeRight
){
void
*
pLeftOut
,
void
*
pRightOut
,
bool
*
isNull
,
bool
*
freeLeft
,
bool
*
freeRight
){
if
(
optr
==
OP_TYPE_JSON_CONTAINS
)
{
if
(
optr
==
OP_TYPE_JSON_CONTAINS
)
{
return
true
;
return
true
;
}
}
if
(
typeLeft
!=
TSDB_DATA_TYPE_JSON
&&
typeRight
!=
TSDB_DATA_TYPE_JSON
)
{
if
(
typeLeft
!=
TSDB_DATA_TYPE_JSON
&&
typeRight
!=
TSDB_DATA_TYPE_JSON
)
{
return
true
;
return
true
;
}
}
if
(
typeLeft
==
TSDB_DATA_TYPE_JSON
)
{
if
(
typeLeft
==
TSDB_DATA_TYPE_JSON
)
{
if
(
tTagIsJson
(
*
pLeftData
))
{
if
(
tTagIsJson
(
*
pLeftData
))
{
terrno
=
TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR
;
terrno
=
TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR
;
return
false
;
return
false
;
}
}
typeLeft
=
**
pLeftData
;
typeLeft
=
**
pLeftData
;
(
*
pLeftData
)
++
;
(
*
pLeftData
)
++
;
}
}
if
(
typeRight
==
TSDB_DATA_TYPE_JSON
)
{
if
(
typeRight
==
TSDB_DATA_TYPE_JSON
)
{
if
(
tTagIsJson
(
*
pLeftData
))
{
if
(
tTagIsJson
(
*
pLeftData
))
{
terrno
=
TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR
;
terrno
=
TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR
;
return
false
;
return
false
;
}
}
...
@@ -554,71 +554,71 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t
...
@@ -554,71 +554,71 @@ bool convertJsonValue(__compar_fn_t *fp, int32_t optr, int8_t typeLeft, int8_t t
(
*
pRightData
)
++
;
(
*
pRightData
)
++
;
}
}
if
(
optr
==
OP_TYPE_LIKE
||
optr
==
OP_TYPE_NOT_LIKE
||
optr
==
OP_TYPE_MATCH
||
optr
==
OP_TYPE_NMATCH
)
{
if
(
optr
==
OP_TYPE_LIKE
||
optr
==
OP_TYPE_NOT_LIKE
||
optr
==
OP_TYPE_MATCH
||
optr
==
OP_TYPE_NMATCH
)
{
if
(
typeLeft
!=
TSDB_DATA_TYPE_NCHAR
&&
typeLeft
!=
TSDB_DATA_TYPE_BINARY
)
{
if
(
typeLeft
!=
TSDB_DATA_TYPE_NCHAR
&&
typeLeft
!=
TSDB_DATA_TYPE_BINARY
)
{
return
false
;
return
false
;
}
}
}
}
// if types can not comparable
// if types can not comparable
if
((
IS_NUMERIC_TYPE
(
typeLeft
)
&&
!
IS_NUMERIC_TYPE
(
typeRight
))
||
if
((
IS_NUMERIC_TYPE
(
typeLeft
)
&&
!
IS_NUMERIC_TYPE
(
typeRight
))
||
(
IS_NUMERIC_TYPE
(
typeRight
)
&&
!
IS_NUMERIC_TYPE
(
typeLeft
))
||
(
IS_NUMERIC_TYPE
(
typeRight
)
&&
!
IS_NUMERIC_TYPE
(
typeLeft
))
||
(
IS_VAR_DATA_TYPE
(
typeLeft
)
&&
!
IS_VAR_DATA_TYPE
(
typeRight
))
||
(
IS_VAR_DATA_TYPE
(
typeLeft
)
&&
!
IS_VAR_DATA_TYPE
(
typeRight
))
||
(
IS_VAR_DATA_TYPE
(
typeRight
)
&&
!
IS_VAR_DATA_TYPE
(
typeLeft
))
||
(
IS_VAR_DATA_TYPE
(
typeRight
)
&&
!
IS_VAR_DATA_TYPE
(
typeLeft
))
||
((
typeLeft
==
TSDB_DATA_TYPE_BOOL
)
&&
(
typeRight
!=
TSDB_DATA_TYPE_BOOL
))
||
((
typeLeft
==
TSDB_DATA_TYPE_BOOL
)
&&
(
typeRight
!=
TSDB_DATA_TYPE_BOOL
))
||
((
typeRight
==
TSDB_DATA_TYPE_BOOL
)
&&
(
typeLeft
!=
TSDB_DATA_TYPE_BOOL
)))
((
typeRight
==
TSDB_DATA_TYPE_BOOL
)
&&
(
typeLeft
!=
TSDB_DATA_TYPE_BOOL
)))
return
false
;
return
false
;
if
(
typeLeft
==
TSDB_DATA_TYPE_NULL
||
typeRight
==
TSDB_DATA_TYPE_NULL
)
{
if
(
typeLeft
==
TSDB_DATA_TYPE_NULL
||
typeRight
==
TSDB_DATA_TYPE_NULL
)
{
*
isNull
=
true
;
*
isNull
=
true
;
return
true
;
return
true
;
}
}
int8_t
type
=
vectorGetConvertType
(
typeLeft
,
typeRight
);
int8_t
type
=
vectorGetConvertType
(
typeLeft
,
typeRight
);
if
(
type
==
0
)
{
if
(
type
==
0
)
{
*
fp
=
filterGetCompFunc
(
typeLeft
,
optr
);
*
fp
=
filterGetCompFunc
(
typeLeft
,
optr
);
return
true
;
return
true
;
}
}
*
fp
=
filterGetCompFunc
(
type
,
optr
);
*
fp
=
filterGetCompFunc
(
type
,
optr
);
if
(
IS_NUMERIC_TYPE
(
type
))
{
if
(
IS_NUMERIC_TYPE
(
type
))
{
if
(
typeLeft
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
typeLeft
==
TSDB_DATA_TYPE_NCHAR
)
{
ASSERT
(
0
);
ASSERT
(
0
);
// convertNcharToDouble(*pLeftData, pLeftOut);
// convertNcharToDouble(*pLeftData, pLeftOut);
// *pLeftData = pLeftOut;
// *pLeftData = pLeftOut;
}
else
if
(
typeLeft
==
TSDB_DATA_TYPE_BINARY
)
{
}
else
if
(
typeLeft
==
TSDB_DATA_TYPE_BINARY
)
{
ASSERT
(
0
);
ASSERT
(
0
);
// convertBinaryToDouble(*pLeftData, pLeftOut);
// convertBinaryToDouble(*pLeftData, pLeftOut);
// *pLeftData = pLeftOut;
// *pLeftData = pLeftOut;
}
else
if
(
typeLeft
!=
type
)
{
}
else
if
(
typeLeft
!=
type
)
{
convertNumberToNumber
(
*
pLeftData
,
pLeftOut
,
typeLeft
,
type
);
convertNumberToNumber
(
*
pLeftData
,
pLeftOut
,
typeLeft
,
type
);
*
pLeftData
=
pLeftOut
;
*
pLeftData
=
pLeftOut
;
}
}
if
(
typeRight
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
typeRight
==
TSDB_DATA_TYPE_NCHAR
)
{
ASSERT
(
0
);
ASSERT
(
0
);
// convertNcharToDouble(*pRightData, pRightOut);
// convertNcharToDouble(*pRightData, pRightOut);
// *pRightData = pRightOut;
// *pRightData = pRightOut;
}
else
if
(
typeRight
==
TSDB_DATA_TYPE_BINARY
)
{
}
else
if
(
typeRight
==
TSDB_DATA_TYPE_BINARY
)
{
ASSERT
(
0
);
ASSERT
(
0
);
// convertBinaryToDouble(*pRightData, pRightOut);
// convertBinaryToDouble(*pRightData, pRightOut);
// *pRightData = pRightOut;
// *pRightData = pRightOut;
}
else
if
(
typeRight
!=
type
)
{
}
else
if
(
typeRight
!=
type
)
{
convertNumberToNumber
(
*
pRightData
,
pRightOut
,
typeRight
,
type
);
convertNumberToNumber
(
*
pRightData
,
pRightOut
,
typeRight
,
type
);
*
pRightData
=
pRightOut
;
*
pRightData
=
pRightOut
;
}
}
}
else
if
(
type
==
TSDB_DATA_TYPE_BINARY
)
{
}
else
if
(
type
==
TSDB_DATA_TYPE_BINARY
)
{
if
(
typeLeft
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
typeLeft
==
TSDB_DATA_TYPE_NCHAR
)
{
*
pLeftData
=
ncharTobinary
(
*
pLeftData
);
*
pLeftData
=
ncharTobinary
(
*
pLeftData
);
*
freeLeft
=
true
;
*
freeLeft
=
true
;
}
}
if
(
typeRight
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
typeRight
==
TSDB_DATA_TYPE_NCHAR
)
{
*
pRightData
=
ncharTobinary
(
*
pRightData
);
*
pRightData
=
ncharTobinary
(
*
pRightData
);
*
freeRight
=
true
;
*
freeRight
=
true
;
}
}
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录