Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5b7e122a
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看板
未验证
提交
5b7e122a
编写于
9月 30, 2022
作者:
H
Hui Li
提交者:
GitHub
9月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17185 from taosdata/fix/coverityScan
fix: fix coverity scan problem
上级
7674fa97
ca041b6d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
25 addition
and
14 deletion
+25
-14
source/libs/index/src/indexFilter.c
source/libs/index/src/indexFilter.c
+2
-2
source/libs/index/src/indexFst.c
source/libs/index/src/indexFst.c
+7
-3
source/libs/index/src/indexFstDfa.c
source/libs/index/src/indexFstDfa.c
+1
-0
source/libs/index/src/indexTfile.c
source/libs/index/src/indexTfile.c
+10
-3
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+1
-1
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+1
-1
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+3
-3
source/os/src/osSocket.c
source/os/src/osSocket.c
+0
-1
未找到文件。
source/libs/index/src/indexFilter.c
浏览文件 @
5b7e122a
...
...
@@ -468,6 +468,7 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP
SIndexMultiTermQuery
*
mtm
=
indexMultiTermQueryCreate
(
MUST
);
indexMultiTermQueryAdd
(
mtm
,
tm
,
qtype
);
ret
=
indexJsonSearch
(
arg
->
ivtIdx
,
mtm
,
output
->
result
);
indexMultiTermQueryDestroy
(
mtm
);
}
else
{
bool
reverse
;
FilterFunc
filterFunc
=
sifGetFilterFunc
(
qtype
,
&
reverse
);
...
...
@@ -647,9 +648,8 @@ static int32_t sifExecOper(SOperatorNode *node, SIFCtx *ctx, SIFParam *output) {
SIF_ERR_RET
(
sifInitOperParams
(
&
params
,
node
,
ctx
));
if
(
params
[
0
].
status
==
SFLT_NOT_INDEX
&&
(
nParam
>
1
&&
params
[
1
].
status
==
SFLT_NOT_INDEX
))
{
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
sifFreeParam
(
&
params
[
i
]);
output
->
status
=
SFLT_NOT_INDEX
;
return
code
;
goto
_return
;
}
// ugly code, refactor later
...
...
source/libs/index/src/indexFst.c
浏览文件 @
5b7e122a
...
...
@@ -1025,6 +1025,7 @@ void fstDestroy(Fst* fst) {
}
bool
fstGet
(
Fst
*
fst
,
FstSlice
*
b
,
Output
*
out
)
{
int
ret
=
false
;
FstNode
*
root
=
fstGetRoot
(
fst
);
Output
tOut
=
0
;
int32_t
len
;
...
...
@@ -1037,7 +1038,7 @@ bool fstGet(Fst* fst, FstSlice* b, Output* out) {
uint8_t
inp
=
data
[
i
];
Output
res
=
0
;
if
(
false
==
fstNodeFindInput
(
root
,
inp
,
&
res
))
{
return
false
;
goto
_return
;
}
FstTransition
trn
;
...
...
@@ -1047,18 +1048,20 @@ bool fstGet(Fst* fst, FstSlice* b, Output* out) {
taosArrayPush
(
nodes
,
&
root
);
}
if
(
!
FST_NODE_IS_FINAL
(
root
))
{
return
false
;
goto
_return
;
}
else
{
tOut
=
tOut
+
FST_NODE_FINAL_OUTPUT
(
root
);
ret
=
true
;
}
_return:
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
nodes
);
i
++
)
{
FstNode
**
node
=
(
FstNode
**
)
taosArrayGet
(
nodes
,
i
);
fstNodeDestroy
(
*
node
);
}
taosArrayDestroy
(
nodes
);
*
out
=
tOut
;
return
true
;
return
ret
;
}
FStmBuilder
*
fstSearch
(
Fst
*
fst
,
FAutoCtx
*
ctx
)
{
// refactor later
...
...
@@ -1243,6 +1246,7 @@ bool stmStSeekMin(FStmSt* sws, FstBoundWithData* min) {
StreamState
s
=
{.
node
=
node
,
.
trans
=
i
,
.
out
=
{.
null
=
false
,
.
out
=
out
},
.
autState
=
autState
};
taosArrayPush
(
sws
->
stack
,
&
s
);
taosMemoryFree
(
trans
);
return
true
;
}
}
...
...
source/libs/index/src/indexFstDfa.c
浏览文件 @
5b7e122a
...
...
@@ -139,6 +139,7 @@ bool dfaBuilderCacheState(FstDfaBuilder *builder, FstSparseSet *set, uint32_t *r
}
}
if
(
taosArrayGetSize
(
tinsts
)
==
0
)
{
taosArrayDestroy
(
tinsts
);
return
false
;
}
uint32_t
*
v
=
taosHashGet
(
builder
->
cache
,
&
tinsts
,
sizeof
(
POINTER_BYTES
));
...
...
source/libs/index/src/indexTfile.c
浏览文件 @
5b7e122a
...
...
@@ -267,10 +267,12 @@ static int32_t tfSearchPrefix(void* reader, SIndexTerm* tem, SIdxTRslt* tr) {
uint64_t
offset
=
*
(
uint64_t
*
)
taosArrayGet
(
offsets
,
i
);
ret
=
tfileReaderLoadTableIds
((
TFileReader
*
)
reader
,
offset
,
tr
->
total
);
if
(
ret
!=
0
)
{
taosArrayDestroy
(
offsets
);
indexError
(
"failed to find target tablelist"
);
return
TSDB_CODE_TDB_FILE_CORRUPTED
;
}
}
taosArrayDestroy
(
offsets
);
return
0
;
}
static
int32_t
tfSearchSuffix
(
void
*
reader
,
SIndexTerm
*
tem
,
SIdxTRslt
*
tr
)
{
...
...
@@ -336,6 +338,7 @@ static int32_t tfSearchCompareFunc(void* reader, SIndexTerm* tem, SIdxTRslt* tr,
}
stmStDestroy
(
st
);
stmBuilderDestroy
(
sb
);
taosArrayDestroy
(
offsets
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
tfSearchLessThan
(
void
*
reader
,
SIndexTerm
*
tem
,
SIdxTRslt
*
tr
)
{
...
...
@@ -379,6 +382,7 @@ static int32_t tfSearchTerm_JSON(void* reader, SIndexTerm* tem, SIdxTRslt* tr) {
", size: %d, time cost: %"
PRIu64
"us"
,
tem
->
suid
,
tem
->
colName
,
tem
->
colVal
,
offset
,
(
int
)
taosArrayGetSize
(
tr
->
total
),
cost
);
}
taosMemoryFree
(
p
);
fstSliceDestroy
(
&
key
);
return
0
;
}
...
...
@@ -471,6 +475,9 @@ static int32_t tfSearchCompareFunc_JSON(void* reader, SIndexTerm* tem, SIdxTRslt
}
stmStDestroy
(
st
);
stmBuilderDestroy
(
sb
);
taosArrayDestroy
(
offsets
);
taosMemoryFree
(
p
);
return
TSDB_CODE_SUCCESS
;
}
int
tfileReaderSearch
(
TFileReader
*
reader
,
SIndexTermQuery
*
query
,
SIdxTRslt
*
tr
)
{
...
...
@@ -898,9 +905,8 @@ static int tfileReaderLoadFst(TFileReader* reader) {
int64_t
ts
=
taosGetTimestampUs
();
int32_t
nread
=
ctx
->
readFrom
(
ctx
,
buf
,
fstSize
,
reader
->
header
.
fstOffset
);
int64_t
cost
=
taosGetTimestampUs
()
-
ts
;
indexInfo
(
"nread = %d, and fst offset=%d, fst size: %d, filename: %s, file size: %"
PRId64
", time cost: %"
PRId64
"us"
,
nread
,
reader
->
header
.
fstOffset
,
fstSize
,
ctx
->
file
.
buf
,
size
,
cost
);
indexInfo
(
"nread = %d, and fst offset=%d, fst size: %d, filename: %s, file size: %d, time cost: %"
PRId64
"us"
,
nread
,
reader
->
header
.
fstOffset
,
fstSize
,
ctx
->
file
.
buf
,
size
,
cost
);
// we assuse fst size less than FST_MAX_SIZE
assert
(
nread
>
0
&&
nread
<=
fstSize
);
...
...
@@ -989,6 +995,7 @@ static SArray* tfileGetFileList(const char* path) {
TdDirPtr
pDir
=
taosOpenDir
(
path
);
if
(
NULL
==
pDir
)
{
taosArrayDestroy
(
files
);
return
NULL
;
}
TdDirEntryPtr
pDirEntry
;
...
...
source/libs/transport/src/transCli.c
浏览文件 @
5b7e122a
...
...
@@ -1347,7 +1347,7 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
EPSET_FORWARD_INUSE
(
&
pCtx
->
epSet
);
}
else
{
if
(
tDeserializeSEpSet
(
pResp
->
pCont
,
pResp
->
contLen
,
&
pCtx
->
epSet
)
<
0
)
{
tError
(
"%s conn %p failed to deserialize epset"
,
CONN_GET_INST_LABEL
(
pConn
));
tError
(
"%s conn %p failed to deserialize epset"
,
CONN_GET_INST_LABEL
(
pConn
)
,
pConn
);
}
}
addConnToPool
(
pThrd
->
pool
,
pConn
);
...
...
source/libs/transport/src/transComm.c
浏览文件 @
5b7e122a
...
...
@@ -509,7 +509,7 @@ void transDQCancel(SDelayQueue* queue, SDelayTask* task) {
if
(
heapSize
(
queue
->
heap
)
!=
0
)
{
HeapNode
*
minNode
=
heapMin
(
queue
->
heap
);
if
(
minNode
!
=
NULL
)
return
;
if
(
minNode
=
=
NULL
)
return
;
uint64_t
now
=
taosGetTimestampMs
();
SDelayTask
*
task
=
container_of
(
minNode
,
SDelayTask
,
node
);
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
5b7e122a
...
...
@@ -284,7 +284,7 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
}
return
;
}
else
{
tError
(
"%s conn %p read invalid packet, exceed limit, received from %s, local info:"
,
transLabel
(
pTransInst
),
tError
(
"%s conn %p read invalid packet, exceed limit, received from %s, local info:
%s
"
,
transLabel
(
pTransInst
),
conn
,
conn
->
dst
,
conn
->
src
);
destroyConn
(
conn
,
true
);
return
;
...
...
@@ -952,10 +952,10 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
#ifdef WINDOWS
char
pipeName
[
64
];
snprintf
(
pipeName
,
sizeof
(
pipeName
),
"
\\\\
?
\\
pipe
\\
trans.rpc.%
p-
"
PRIu64
,
taosSafeRand
(),
GetCurrentProcessId
());
snprintf
(
pipeName
,
sizeof
(
pipeName
),
"
\\\\
?
\\
pipe
\\
trans.rpc.%
d-%
"
PRIu64
,
taosSafeRand
(),
GetCurrentProcessId
());
#else
char
pipeName
[
PATH_MAX
]
=
{
0
};
snprintf
(
pipeName
,
sizeof
(
pipeName
),
"%s%spipe.trans.rpc.%08
X-
"
PRIu64
,
tsTempDir
,
TD_DIRSEP
,
taosSafeRand
(),
snprintf
(
pipeName
,
sizeof
(
pipeName
),
"%s%spipe.trans.rpc.%08
d-%
"
PRIu64
,
tsTempDir
,
TD_DIRSEP
,
taosSafeRand
(),
taosGetSelfPthreadId
());
#endif
ret
=
uv_pipe_bind
(
&
srv
->
pipeListen
,
pipeName
);
...
...
source/os/src/osSocket.c
浏览文件 @
5b7e122a
...
...
@@ -801,7 +801,6 @@ TdSocketServerPtr taosOpenTcpServerSocket(uint32_t ip, uint16_t port) {
if
(
taosKeepTcpAlive
(
pSocket
)
<
0
)
{
// printf("failed to set tcp server keep-alive option, 0x%x:%hu(%s)", ip, port, strerror(errno));
taosCloseSocket
(
&
pSocket
);
return
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录