Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
22d59537
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
22d59537
编写于
12月 17, 2021
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change taosArrayDestroy(*)->taosArrayDestroy(**)
上级
0e0a4c09
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
98 addition
and
102 deletion
+98
-102
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+7
-7
src/client/src/tscParseOpenTSDB.c
src/client/src/tscParseOpenTSDB.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+6
-6
src/client/src/tscSub.c
src/client/src/tscSub.c
+4
-4
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+10
-10
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+5
-5
src/common/src/tdataformat.c
src/common/src/tdataformat.c
+1
-1
src/common/src/tvariant.c
src/common/src/tvariant.c
+2
-4
src/connector/go
src/connector/go
+1
-1
src/kit/taos-tools
src/kit/taos-tools
+1
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+1
-1
src/plugins/taosadapter
src/plugins/taosadapter
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/query/src/qPlan.c
src/query/src/qPlan.c
+3
-3
src/query/src/qResultbuf.c
src/query/src/qResultbuf.c
+2
-2
src/query/src/qSqlParser.c
src/query/src/qSqlParser.c
+3
-3
src/query/src/qUtil.c
src/query/src/qUtil.c
+5
-5
src/query/src/queryMain.c
src/query/src/queryMain.c
+5
-6
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+3
-3
src/tsdb/src/tsdbFS.c
src/tsdb/src/tsdbFS.c
+11
-11
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+6
-6
src/tsdb/src/tsdbReadImpl.c
src/tsdb/src/tsdbReadImpl.c
+1
-1
src/util/inc/tarray.h
src/util/inc/tarray.h
+2
-2
src/util/src/hash.c
src/util/src/hash.c
+1
-1
src/util/src/tarray.c
src/util/src/tarray.c
+11
-12
src/util/src/tcache.c
src/util/src/tcache.c
+1
-1
src/util/tests/skiplistTest.cpp
src/util/tests/skiplistTest.cpp
+2
-2
未找到文件。
src/client/src/tscParseLineProtocol.c
浏览文件 @
22d59537
...
...
@@ -517,8 +517,8 @@ static int32_t applySchemaAction(TAOS* taos, SSchemaAction* action, SSmlLinesInf
static
int32_t
destroySmlSTableSchema
(
SSmlSTableSchema
*
schema
)
{
taosHashCleanup
(
schema
->
tagHash
);
taosHashCleanup
(
schema
->
fieldHash
);
taosArrayDestroy
(
schema
->
tags
);
taosArrayDestroy
(
schema
->
fields
);
taosArrayDestroy
(
&
schema
->
tags
);
taosArrayDestroy
(
&
schema
->
fields
);
return
0
;
}
...
...
@@ -969,13 +969,13 @@ static int32_t applyChildTableDataPointsWithStmt(TAOS* taos, char* cTableName, c
}
free
(
colBinds
);
}
taosArrayDestroy
(
rowsBind
);
taosArrayDestroy
(
&
rowsBind
);
//free tag bind
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
tagBinds
);
++
i
)
{
TAOS_BIND
*
bind
=
taosArrayGet
(
tagBinds
,
i
);
free
(
bind
->
length
);
}
taosArrayDestroy
(
tagBinds
);
taosArrayDestroy
(
&
tagBinds
);
return
code
;
}
...
...
@@ -1036,7 +1036,7 @@ static int32_t insertChildTablePointsBatch(TAOS* taos, char* cTableName, char* s
tscDebug
(
"SML:0x%"
PRIx64
" insert child table batch from line %d to line %d."
,
info
->
id
,
i
,
j
-
1
);
code
=
doInsertChildTablePoints
(
taos
,
sql
,
cTableName
,
tagsBind
,
batchBind
,
info
);
if
(
code
!=
0
)
{
taosArrayDestroy
(
batchBind
);
taosArrayDestroy
(
&
batchBind
);
tfree
(
sql
);
return
code
;
}
...
...
@@ -1044,7 +1044,7 @@ static int32_t insertChildTablePointsBatch(TAOS* taos, char* cTableName, char* s
}
i
=
j
;
}
taosArrayDestroy
(
batchBind
);
taosArrayDestroy
(
&
batchBind
);
tfree
(
sql
);
return
code
;
...
...
@@ -1196,7 +1196,7 @@ cleanup:
pCTablePoints
=
taosHashIterate
(
cname2points
,
NULL
);
while
(
pCTablePoints
)
{
SArray
*
pPoints
=
*
pCTablePoints
;
taosArrayDestroy
(
pPoints
);
taosArrayDestroy
(
&
pPoints
);
pCTablePoints
=
taosHashIterate
(
cname2points
,
pCTablePoints
);
}
taosHashCleanup
(
cname2points
);
...
...
src/client/src/tscParseOpenTSDB.c
浏览文件 @
22d59537
...
...
@@ -472,7 +472,7 @@ cleanup:
destroySmlDataPoint
(
points
+
i
);
}
taosArrayDestroy
(
lpPoints
);
taosArrayDestroy
(
&
lpPoints
);
tfree
(
info
);
return
code
;
...
...
src/client/src/tscServer.c
浏览文件 @
22d59537
...
...
@@ -1175,8 +1175,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
_end:
freeQueryAttr
(
&
query
);
taosArrayDestroy
(
tableScanOperator
);
taosArrayDestroy
(
queryOperator
);
taosArrayDestroy
(
&
tableScanOperator
);
taosArrayDestroy
(
&
queryOperator
);
return
code
;
}
...
...
@@ -2259,7 +2259,7 @@ int tscProcessRetrieveFuncRsp(SSqlObj* pSql) {
SQueryInfo
*
parQueryInfo
=
tscGetQueryInfo
(
&
parent
->
cmd
);
assert
(
parent
->
signature
==
parent
&&
(
int64_t
)
pSql
->
param
==
parent
->
self
);
taosArrayDestroy
(
parQueryInfo
->
pUdfInfo
);
taosArrayDestroy
(
&
parQueryInfo
->
pUdfInfo
);
parQueryInfo
->
pUdfInfo
=
pQueryInfo
->
pUdfInfo
;
// assigned to parent sql obj.
pQueryInfo
->
pUdfInfo
=
NULL
;
...
...
@@ -2371,7 +2371,7 @@ int tscProcessMultiTableMetaRsp(SSqlObj *pSql) {
int32_t
size
=
0
;
if
(
p
->
vgroupIdList
!=
NULL
)
{
taosArrayDestroy
(
p
->
vgroupIdList
);
taosArrayDestroy
(
&
p
->
vgroupIdList
);
}
p
->
vgroupIdList
=
createVgroupIdListFromMsg
(
pParentSql
,
pMsg
,
pSet
,
fname
,
&
size
,
pSql
->
self
);
...
...
@@ -3116,8 +3116,8 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
char
*
n
=
strdup
(
name
);
taosArrayPush
(
pNameList
,
&
n
);
code
=
getMultiTableMetaFromMnode
(
tmpSql
,
pNameList
,
vgroupList
,
NULL
,
tscTableMetaCallBack
,
true
);
taosArrayDestroyEx
(
pNameList
,
freeElem
);
taosArrayDestroyEx
(
vgroupList
,
freeElem
);
taosArrayDestroyEx
(
&
pNameList
,
freeElem
);
taosArrayDestroyEx
(
&
vgroupList
,
freeElem
);
return
code
;
}
...
...
src/client/src/tscSub.c
浏览文件 @
22d59537
...
...
@@ -194,7 +194,7 @@ fail:
}
if
(
pSub
!=
NULL
)
{
taosArrayDestroy
(
pSub
->
progress
);
taosArrayDestroy
(
&
pSub
->
progress
);
tsem_destroy
(
&
pSub
->
sem
);
free
(
pSub
);
pSub
=
NULL
;
...
...
@@ -300,7 +300,7 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) {
}
taosArraySort
(
progress
,
tscCompareSubscriptionProgress
);
taosArrayDestroy
(
pSub
->
progress
);
taosArrayDestroy
(
&
pSub
->
progress
);
pSub
->
progress
=
progress
;
if
(
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
...
...
@@ -308,7 +308,7 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) {
tscFreeVgroupTableInfo
(
pTableMetaInfo
->
pVgroupTables
);
tscBuildVgroupTableInfo
(
pSql
,
pTableMetaInfo
,
tables
);
}
taosArrayDestroy
(
tables
);
taosArrayDestroy
(
&
tables
);
if
(
pTableMetaInfo
->
pVgroupTables
&&
taosArrayGetSize
(
pTableMetaInfo
->
pVgroupTables
)
>
0
)
{
TSDB_QUERY_SET_TYPE
(
tscGetQueryInfo
(
pCmd
)
->
type
,
TSDB_QUERY_TYPE_MULTITABLE_QUERY
);
...
...
@@ -626,7 +626,7 @@ void taos_unsubscribe(TAOS_SUB *tsub, int keepProgress) {
}
}
taosArrayDestroy
(
pSub
->
progress
);
taosArrayDestroy
(
&
pSub
->
progress
);
tsem_destroy
(
&
pSub
->
sem
);
memset
(
pSub
,
0
,
sizeof
(
*
pSub
));
free
(
pSub
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
22d59537
...
...
@@ -431,7 +431,7 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
// tscFieldInfoClear(&pSupporter->fieldsInfo);
if
(
pSupporter
->
fieldsInfo
.
internalField
!=
NULL
)
{
taosArrayDestroy
(
pSupporter
->
fieldsInfo
.
internalField
);
taosArrayDestroy
(
&
pSupporter
->
fieldsInfo
.
internalField
);
}
if
(
pSupporter
->
pTSBuf
!=
NULL
)
{
tsBufDestroy
(
pSupporter
->
pTSBuf
);
...
...
@@ -446,7 +446,7 @@ static void tscDestroyJoinSupporter(SJoinSupporter* pSupporter) {
}
if
(
pSupporter
->
pVgroupTables
!=
NULL
)
{
//taosArrayDestroy(pSupporter->pVgroupTables);
//taosArrayDestroy(
&
pSupporter->pVgroupTables);
tscFreeVgroupTableInfo
(
pSupporter
->
pVgroupTables
);
pSupporter
->
pVgroupTables
=
NULL
;
}
...
...
@@ -804,7 +804,7 @@ void tscBuildVgroupTableInfo(SSqlObj* pSql, STableMetaInfo* pTableMetaInfo, SArr
if
(
taosArrayGetSize
(
result
)
<=
0
)
{
pTableMetaInfo
->
pVgroupTables
=
NULL
;
taosArrayDestroy
(
result
);
taosArrayDestroy
(
&
result
);
}
else
{
pTableMetaInfo
->
pVgroupTables
=
result
;
...
...
@@ -967,7 +967,7 @@ static int32_t getIntersectionOfTableTuple(SQueryInfo* pQueryInfo, SSqlObj* pPar
if
(
!
checkForDuplicateTagVal
(
pColSchema
,
p
,
pParentSql
))
{
for
(
int32_t
j
=
0
;
j
<=
i
;
j
++
)
{
taosArrayDestroy
(
ctxlist
[
j
].
res
);
taosArrayDestroy
(
&
ctxlist
[
j
].
res
);
}
return
TSDB_CODE_QRY_DUP_JOIN_KEY
;
}
...
...
@@ -1269,7 +1269,7 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
pParentSql
->
res
.
code
=
code
;
tscAsyncResultOnError
(
pParentSql
);
taosArrayDestroy
(
resList
);
taosArrayDestroy
(
&
resList
);
goto
_return
;
}
...
...
@@ -1309,11 +1309,11 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow
for
(
int32_t
i
=
0
;
i
<
rsize
;
++
i
)
{
SArray
**
s
=
taosArrayGet
(
resList
,
i
);
if
(
*
s
)
{
taosArrayDestroy
(
*
s
);
taosArrayDestroy
(
s
);
}
}
taosArrayDestroy
(
resList
);
taosArrayDestroy
(
&
resList
);
_return:
taosReleaseRef
(
tscObjRef
,
handle
);
...
...
@@ -1993,7 +1993,7 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
pNewQueryInfo
->
limit
.
limit
=
-
1
;
pNewQueryInfo
->
limit
.
offset
=
0
;
taosArrayDestroy
(
pNewQueryInfo
->
pUpstream
);
taosArrayDestroy
(
&
pNewQueryInfo
->
pUpstream
);
pNewQueryInfo
->
order
.
orderColId
=
INT32_MIN
;
...
...
@@ -2255,8 +2255,8 @@ void doAppendData(SInterResult* pInterResult, TAOS_ROW row, int32_t numOfCols, S
static
void
tscFreeFirstRoundSup
(
void
**
param
)
{
if
(
*
param
)
{
SFirstRoundQuerySup
*
pSup
=
(
SFirstRoundQuerySup
*
)
*
param
;
taosArrayDestroyEx
(
pSup
->
pResult
,
freeInterResult
);
taosArrayDestroy
(
pSup
->
pColsInfo
);
taosArrayDestroyEx
(
&
pSup
->
pResult
,
freeInterResult
);
taosArrayDestroy
(
&
pSup
->
pColsInfo
);
tfree
(
*
param
);
}
}
...
...
src/client/src/tscUtil.c
浏览文件 @
22d59537
...
...
@@ -1540,7 +1540,7 @@ void tscFreeQueryInfo(SSqlCmd* pCmd, bool removeCachedMeta, uint64_t id) {
}
if
(
pQueryInfo
->
udfCopy
)
{
pQueryInfo
->
pUdfInfo
=
taosArrayDestroy
(
pQueryInfo
->
pUdfInfo
);
pQueryInfo
->
pUdfInfo
=
taosArrayDestroy
(
&
pQueryInfo
->
pUdfInfo
);
}
else
{
pQueryInfo
->
pUdfInfo
=
tscDestroyUdfArrayList
(
pQueryInfo
->
pUdfInfo
);
}
...
...
@@ -1602,7 +1602,7 @@ void* tscCleanupTableMetaMap(SHashObj* pTableMetaMap) {
STableMetaVgroupInfo
*
p
=
taosHashIterate
(
pTableMetaMap
,
NULL
);
while
(
p
)
{
taosArrayDestroy
(
p
->
vgroupIdList
);
taosArrayDestroy
(
&
p
->
vgroupIdList
);
tfree
(
p
->
pTableMeta
);
p
=
taosHashIterate
(
pTableMetaMap
,
p
);
}
...
...
@@ -1795,7 +1795,7 @@ void* tscDestroyBlockArrayList(SSqlObj *pSql, SArray* pDataBlockList) {
tscDestroyDataBlock
(
pSql
,
d
,
false
);
}
taosArrayDestroy
(
pDataBlockList
);
taosArrayDestroy
(
&
pDataBlockList
);
return
NULL
;
}
...
...
@@ -1834,7 +1834,7 @@ void* tscDestroyUdfArrayList(SArray* pUdfList) {
freeUdfInfo
(
udf
);
}
taosArrayDestroy
(
pUdfList
);
taosArrayDestroy
(
&
pUdfList
);
return
NULL
;
}
...
...
@@ -2470,7 +2470,7 @@ void tscFieldInfoClear(SFieldInfo* pFieldInfo) {
}
}
taosArrayDestroy
(
pFieldInfo
->
internalField
);
taosArrayDestroy
(
&
pFieldInfo
->
internalField
);
tfree
(
pFieldInfo
->
final
);
memset
(
pFieldInfo
,
0
,
sizeof
(
SFieldInfo
));
...
...
src/common/src/tdataformat.c
浏览文件 @
22d59537
...
...
@@ -894,6 +894,6 @@ SMemRow mergeTwoMemRows(void *buffer, SMemRow row1, SMemRow row2, STSchema *pSch
}
ASSERT
(
kvLen
==
memRowTLen
(
tRow
));
}
taosArrayDestroy
(
stashRow
);
taosArrayDestroy
(
&
stashRow
);
return
buffer
;
}
src/common/src/tvariant.c
浏览文件 @
22d59537
...
...
@@ -222,11 +222,9 @@ void tVariantDestroy(tVariant *pVar) {
void
*
p
=
taosArrayGetP
(
pVar
->
arr
,
i
);
free
(
p
);
}
taosArrayDestroy
(
pVar
->
arr
);
pVar
->
arr
=
NULL
;
taosArrayDestroy
(
&
pVar
->
arr
);
}
else
if
(
pVar
->
nType
==
TSDB_DATA_TYPE_VALUE_ARRAY
)
{
taosArrayDestroy
(
pVar
->
arr
);
pVar
->
arr
=
NULL
;
taosArrayDestroy
(
&
pVar
->
arr
);
}
}
...
...
go
@
41787fd5
比较
7da3cc9e
...
41787fd5
Subproject commit
7da3cc9e4ad1030c2eec250b869a8fa215b4a4b4
Subproject commit
41787fd5b8baacabb95e16ecda2b45283dfe85d2
taos-tools
@
efd744e7
比较
7eae58a0
...
efd744e7
Subproject commit
7eae58a0fbf7c7321dd1bdc96e375d4c832cf373
Subproject commit
efd744e73658de83c885377c62d89b7780658c6f
src/mnode/src/mnodeTable.c
浏览文件 @
22d59537
...
...
@@ -3155,7 +3155,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
_end:
tfree
(
str
);
tfree
(
nameList
);
taosArrayDestroy
(
pList
);
taosArrayDestroy
(
&
pList
);
pMsg
->
pTable
=
NULL
;
pMsg
->
pVgroup
=
NULL
;
tfree
(
pMultiMeta
);
...
...
taosadapter
@
07f0d3bb
比较
88346a2e
...
07f0d3bb
Subproject commit
88346a2e4e2e9282d2ec8b8c5264ca1ec23698a1
Subproject commit
07f0d3bb0823e80e05b40cc03fa2e1e6767ef442
src/query/src/qExecutor.c
浏览文件 @
22d59537
...
...
@@ -291,7 +291,7 @@ static int compareRowData(const void *a, const void *b, const void *userData) {
static
void
sortGroupResByOrderList
(
SGroupResInfo
*
pGroupResInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
SSDataBlock
*
pDataBlock
,
SQLFunctionCtx
*
pCtx
)
{
SArray
*
columnOrderList
=
getOrderCheckColumns
(
pRuntimeEnv
->
pQueryAttr
);
size_t
size
=
taosArrayGetSize
(
columnOrderList
);
taosArrayDestroy
(
columnOrderList
);
taosArrayDestroy
(
&
columnOrderList
);
if
(
size
<=
0
)
{
return
;
...
...
@@ -368,7 +368,7 @@ void* destroyOutputBuf(SSDataBlock* pBlock) {
tfree
(
pColInfoData
->
pData
);
}
taosArrayDestroy
(
pBlock
->
pDataBlock
);
taosArrayDestroy
(
&
pBlock
->
pDataBlock
);
tfree
(
pBlock
->
pBlockStatis
);
tfree
(
pBlock
);
return
NULL
;
...
...
src/query/src/qPlan.c
浏览文件 @
22d59537
...
...
@@ -224,7 +224,7 @@ SArray* createQueryPlanImpl(SQueryInfo* pQueryInfo) {
if
(
pQueryInfo
->
numOfTables
>
1
)
{
// it is a join query
// 1. separate the select clause according to table
taosArrayDestroy
(
upstream
);
taosArrayDestroy
(
&
upstream
);
upstream
=
taosArrayInit
(
5
,
POINTER_BYTES
);
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
numOfTables
;
++
i
)
{
...
...
@@ -279,7 +279,7 @@ SQueryNode* qCreateQueryPlan(SQueryInfo* pQueryInfo) {
assert
(
taosArrayGetSize
(
upstream
)
==
1
);
SQueryNode
*
p
=
taosArrayGetP
(
upstream
,
0
);
taosArrayDestroy
(
upstream
);
taosArrayDestroy
(
&
upstream
);
return
p
;
}
...
...
@@ -300,7 +300,7 @@ static void doDestroyQueryNode(SQueryNode* pQueryNode) {
doDestroyQueryNode
(
p
);
}
taosArrayDestroy
(
pQueryNode
->
pPrevNodes
);
taosArrayDestroy
(
&
pQueryNode
->
pPrevNodes
);
}
tfree
(
pQueryNode
);
...
...
src/query/src/qResultbuf.c
浏览文件 @
22d59537
...
...
@@ -433,12 +433,12 @@ void destroyResultBuf(SDiskbasedResultBuf* pResultBuf) {
tfree
(
pi
);
}
taosArrayDestroy
(
*
p
);
taosArrayDestroy
(
p
);
p
=
taosHashIterate
(
pResultBuf
->
groupSet
,
p
);
}
tdListFree
(
pResultBuf
->
lruList
);
taosArrayDestroy
(
pResultBuf
->
emptyDummyIdList
);
taosArrayDestroy
(
&
pResultBuf
->
emptyDummyIdList
);
taosHashCleanup
(
pResultBuf
->
groupSet
);
taosHashCleanup
(
pResultBuf
->
all
);
...
...
src/query/src/qSqlParser.c
浏览文件 @
22d59537
...
...
@@ -117,7 +117,7 @@ void tSqlExprListDestroy(SArray *pList) {
return
;
}
taosArrayDestroyEx
(
pList
,
freeExprElem
);
taosArrayDestroyEx
(
&
pList
,
freeExprElem
);
}
...
...
@@ -687,14 +687,14 @@ void* destroyRelationInfo(SRelationInfo* pRelationInfo) {
}
if
(
pRelationInfo
->
type
==
SQL_NODE_FROM_TABLELIST
)
{
taosArrayDestroy
(
pRelationInfo
->
list
);
taosArrayDestroy
(
&
pRelationInfo
->
list
);
}
else
{
size_t
size
=
taosArrayGetSize
(
pRelationInfo
->
list
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SArray
*
pa
=
taosArrayGetP
(
pRelationInfo
->
list
,
i
);
destroyAllSqlNode
(
pa
);
}
taosArrayDestroy
(
pRelationInfo
->
list
);
taosArrayDestroy
(
&
pRelationInfo
->
list
);
}
tfree
(
pRelationInfo
);
...
...
src/query/src/qUtil.c
浏览文件 @
22d59537
...
...
@@ -248,7 +248,7 @@ void* destroyResultRowPool(SResultRowPool* p) {
tfree
(
*
ptr
);
}
taosArrayDestroy
(
p
->
pData
);
taosArrayDestroy
(
&
p
->
pData
);
tfree
(
p
);
return
NULL
;
...
...
@@ -341,23 +341,23 @@ void freeInterResult(void* param) {
int32_t
numOfCols
=
(
int32_t
)
taosArrayGetSize
(
pResult
->
pResult
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SStddevInterResult
*
p
=
taosArrayGet
(
pResult
->
pResult
,
i
);
taosArrayDestroy
(
p
->
pResult
);
taosArrayDestroy
(
&
p
->
pResult
);
}
taosArrayDestroy
(
pResult
->
pResult
);
taosArrayDestroy
(
&
pResult
->
pResult
);
}
void
cleanupGroupResInfo
(
SGroupResInfo
*
pGroupResInfo
)
{
assert
(
pGroupResInfo
!=
NULL
);
taosArrayDestroy
(
pGroupResInfo
->
pRows
);
taosArrayDestroy
(
&
pGroupResInfo
->
pRows
);
pGroupResInfo
->
pRows
=
NULL
;
pGroupResInfo
->
index
=
0
;
}
void
initGroupResInfo
(
SGroupResInfo
*
pGroupResInfo
,
SResultRowInfo
*
pResultInfo
)
{
if
(
pGroupResInfo
->
pRows
!=
NULL
)
{
taosArrayDestroy
(
pGroupResInfo
->
pRows
);
taosArrayDestroy
(
&
pGroupResInfo
->
pRows
);
}
pGroupResInfo
->
pRows
=
taosArrayFromList
(
pResultInfo
->
pResult
,
pResultInfo
->
size
,
POINTER_BYTES
);
...
...
src/query/src/queryMain.c
浏览文件 @
22d59537
...
...
@@ -54,7 +54,7 @@ void freeParam(SQueryParam *param) {
tfree
(
param
->
sql
);
tfree
(
param
->
tagCond
);
tfree
(
param
->
pTableIdList
);
taosArrayDestroy
(
param
->
pOperator
);
taosArrayDestroy
(
&
param
->
pOperator
);
tfree
(
param
->
pExprs
);
tfree
(
param
->
pSecExprs
);
...
...
@@ -186,15 +186,14 @@ int32_t qCreateQueryInfo(void* tsdb, int32_t vgId, SQueryTableMsg* pQueryMsg, qi
_over:
if
(
param
.
pGroupbyExpr
!=
NULL
)
{
taosArrayDestroy
(
param
.
pGroupbyExpr
->
columnInfo
);
taosArrayDestroy
(
&
(
param
.
pGroupbyExpr
->
columnInfo
)
);
}
tfree
(
param
.
colCond
);
destroyUdfInfo
(
param
.
pUdfInfo
);
taosArrayDestroy
(
param
.
pTableIdList
);
param
.
pTableIdList
=
NULL
;
taosArrayDestroy
(
&
param
.
pTableIdList
);
freeParam
(
&
param
);
...
...
@@ -714,7 +713,7 @@ void* qObtainLongQuery(void* param){
size_t
cnt
=
taosArrayGetSize
(
qids
);
if
(
cnt
==
0
)
{
taosArrayDestroy
(
qids
);
taosArrayDestroy
(
&
qids
);
return
NULL
;
}
if
(
cnt
>
1
)
...
...
@@ -754,7 +753,7 @@ bool qFixedNoBlock(void* pRepo, void* pMgmt, int32_t longQueryMs) {
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
free
(
taosArrayGetP
(
qids
,
i
));
}
taosArrayDestroy
(
qids
);
taosArrayDestroy
(
&
qids
);
return
fixed
;
}
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
22d59537
...
...
@@ -892,9 +892,9 @@ static int tsdbInitCommitH(SCommitH *pCommith, STsdbRepo *pRepo) {
static
void
tsdbDestroyCommitH
(
SCommitH
*
pCommith
)
{
pCommith
->
pDataCols
=
tdFreeDataCols
(
pCommith
->
pDataCols
);
pCommith
->
aSubBlk
=
taosArrayDestroy
(
pCommith
->
aSubBlk
);
pCommith
->
aSupBlk
=
taosArrayDestroy
(
pCommith
->
aSupBlk
);
pCommith
->
aBlkIdx
=
taosArrayDestroy
(
pCommith
->
aBlkIdx
);
pCommith
->
aSubBlk
=
taosArrayDestroy
(
&
pCommith
->
aSubBlk
);
pCommith
->
aSupBlk
=
taosArrayDestroy
(
&
pCommith
->
aSupBlk
);
pCommith
->
aBlkIdx
=
taosArrayDestroy
(
&
pCommith
->
aBlkIdx
);
tsdbDestroyCommitIters
(
pCommith
);
tsdbDestroyReadH
(
&
(
pCommith
->
readh
));
tsdbCloseDFileSet
(
TSDB_COMMIT_WRITE_FSET
(
pCommith
));
...
...
src/tsdb/src/tsdbFS.c
浏览文件 @
22d59537
...
...
@@ -159,7 +159,7 @@ static SFSStatus *tsdbNewFSStatus(int maxFSet) {
static
SFSStatus
*
tsdbFreeFSStatus
(
SFSStatus
*
pStatus
)
{
if
(
pStatus
)
{
pStatus
->
df
=
taosArrayDestroy
(
pStatus
->
df
);
pStatus
->
df
=
taosArrayDestroy
(
&
pStatus
->
df
);
free
(
pStatus
);
}
...
...
@@ -1139,7 +1139,7 @@ static int tsdbFetchTFileSet(STsdbRepo *pRepo, SArray **fArray) {
if
(
tdir
==
NULL
)
{
tsdbError
(
"vgId:%d failed to fetch TFileSet while open directory %s since %s"
,
REPO_ID
(
pRepo
),
dataDir
,
tstrerror
(
terrno
));
taosArrayDestroy
(
*
fArray
);
taosArrayDestroy
(
fArray
);
regfree
(
&
regex
);
return
-
1
;
}
...
...
@@ -1152,7 +1152,7 @@ static int tsdbFetchTFileSet(STsdbRepo *pRepo, SArray **fArray) {
if
(
taosArrayPush
(
*
fArray
,
(
void
*
)
pf
)
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
tfsClosedir
(
tdir
);
taosArrayDestroy
(
*
fArray
);
taosArrayDestroy
(
fArray
);
regfree
(
&
regex
);
return
-
1
;
}
...
...
@@ -1166,7 +1166,7 @@ static int tsdbFetchTFileSet(STsdbRepo *pRepo, SArray **fArray) {
tsdbError
(
"vgId:%d failed to fetch TFileSet Array while run regexec since %s"
,
REPO_ID
(
pRepo
),
strerror
(
code
));
terrno
=
TAOS_SYSTEM_ERROR
(
code
);
tfsClosedir
(
tdir
);
taosArrayDestroy
(
*
fArray
);
taosArrayDestroy
(
fArray
);
regfree
(
&
regex
);
return
-
1
;
}
...
...
@@ -1207,7 +1207,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
}
if
((
fArraySize
=
taosArrayGetSize
(
fArray
))
<=
0
)
{
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
tsdbInfo
(
"vgId:%d size of DFileSet from %s is %"
PRIu32
,
REPO_ID
(
pRepo
),
dataDir
,
(
uint32_t
)
fArraySize
);
return
0
;
}
...
...
@@ -1258,7 +1258,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// return error in case of removing uncomplete DFileSets
terrno
=
TSDB_CODE_TDB_INCOMPLETE_DFILESET
;
tsdbError
(
"vgId:%d incomplete DFileSet, fid:%d, nDFiles=%"
PRIu8
,
REPO_ID
(
pRepo
),
fset
.
fid
,
nDFiles
);
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
return
-
1
;
}
}
...
...
@@ -1271,7 +1271,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// return error in case of removing uncomplete DFileSets
terrno
=
TSDB_CODE_TDB_INCOMPLETE_DFILESET
;
tsdbError
(
"vgId:%d incomplete DFileSet, fid:%d, nDFiles=%"
PRIu8
,
REPO_ID
(
pRepo
),
fset
.
fid
,
nDFiles
);
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
return
-
1
;
#if 0
// next FSet
...
...
@@ -1293,14 +1293,14 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
if
(
tsdbOpenDFile
(
pDFile1
,
O_RDONLY
)
<
0
)
{
tsdbError
(
"vgId:%d failed to open DFile %s since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pDFile1
),
tstrerror
(
terrno
));
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
return
-
1
;
}
if
(
tsdbLoadDFileHeader
(
pDFile1
,
&
(
pDFile1
->
info
))
<
0
)
{
tsdbError
(
"vgId:%d failed to load DFile %s header since %s"
,
REPO_ID
(
pRepo
),
TSDB_FILE_FULL_NAME
(
pDFile1
),
tstrerror
(
terrno
));
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
return
-
1
;
}
...
...
@@ -1310,7 +1310,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// Get real file size
if
(
fstat
(
pDFile1
->
fd
,
&
tfstat
)
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
return
-
1
;
}
...
...
@@ -1346,7 +1346,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
}
// Resource release
taosArrayDestroy
(
fArray
);
taosArrayDestroy
(
&
fArray
);
return
0
;
}
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
22d59537
...
...
@@ -219,7 +219,7 @@ static void tsdbMayTakeMemSnapshot(STsdbQueryHandle* pQueryHandle, SArray* psTab
tsdbTakeMemSnapshot
(
pQueryHandle
->
pTsdb
,
&
(
pMemRef
->
snapshot
),
psTable
);
}
taosArrayDestroy
(
psTable
);
taosArrayDestroy
(
&
psTable
);
}
static
void
tsdbMayUnTakeMemSnapshot
(
STsdbQueryHandle
*
pQueryHandle
)
{
...
...
@@ -277,7 +277,7 @@ static SArray* createCheckInfoFromTableGroup(STsdbQueryHandle* pQueryHandle, STa
SArray
*
pTable
=
taosArrayInit
(
4
,
sizeof
(
STable
*
));
if
(
pTable
==
NULL
)
{
taosArrayDestroy
(
pTableCheckInfo
);
taosArrayDestroy
(
&
pTableCheckInfo
);
return
NULL
;
}
...
...
@@ -505,7 +505,7 @@ TsdbQueryHandleT* tsdbQueryTables(STsdbRepo* tsdb, STsdbQueryCond* pCond, STable
pQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromTableGroup
(
pQueryHandle
,
groupList
,
pMeta
,
&
psTable
);
if
(
pQueryHandle
->
pTableCheckInfo
==
NULL
)
{
tsdbCleanupQueryHandle
(
pQueryHandle
);
taosArrayDestroy
(
psTable
);
taosArrayDestroy
(
&
psTable
);
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
NULL
;
}
...
...
@@ -3125,7 +3125,7 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
SArray
*
psTable
=
NULL
;
pSecQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromCheckInfo
(
pCurrent
,
pSecQueryHandle
->
window
.
skey
,
&
psTable
);
if
(
pSecQueryHandle
->
pTableCheckInfo
==
NULL
)
{
taosArrayDestroy
(
psTable
);
taosArrayDestroy
(
&
psTable
);
terrno
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
goto
out_of_memory
;
}
...
...
@@ -3331,7 +3331,7 @@ STimeWindow updateLastrowForEachGroup(STableGroupInfo *groupList) {
taosArrayPush
(
pGroup
,
&
keyInfo
);
}
}
else
{
// mark all the empty groups, and remove it later
taosArrayDestroy
(
pGroup
);
taosArrayDestroy
(
&
pGroup
);
taosArrayPush
(
emptyGroup
,
&
j
);
}
}
...
...
@@ -3343,7 +3343,7 @@ STimeWindow updateLastrowForEachGroup(STableGroupInfo *groupList) {
}
taosArrayRemoveBatch
(
groupList
->
pGroupList
,
TARRAY_GET_START
(
emptyGroup
),
(
int32_t
)
taosArrayGetSize
(
emptyGroup
));
taosArrayDestroy
(
emptyGroup
);
taosArrayDestroy
(
&
emptyGroup
);
groupList
->
numOfTables
=
totalNumOfTable
;
return
window
;
...
...
src/tsdb/src/tsdbReadImpl.c
浏览文件 @
22d59537
...
...
@@ -74,7 +74,7 @@ void tsdbDestroyReadH(SReadH *pReadh) {
pReadh
->
cidx
=
0
;
pReadh
->
pBlkIdx
=
NULL
;
pReadh
->
pTable
=
NULL
;
pReadh
->
aBlkIdx
=
taosArrayDestroy
(
pReadh
->
aBlkIdx
);
pReadh
->
aBlkIdx
=
taosArrayDestroy
(
&
pReadh
->
aBlkIdx
);
tsdbCloseDFileSet
(
TSDB_READ_FSET
(
pReadh
));
pReadh
->
pRepo
=
NULL
;
}
...
...
src/util/inc/tarray.h
浏览文件 @
22d59537
...
...
@@ -176,7 +176,7 @@ void taosArrayClear(SArray* pArray);
* destroy array list
* @param pArray
*/
void
*
taosArrayDestroy
(
SArray
*
pArray
);
void
*
taosArrayDestroy
(
SArray
*
*
pArray
);
/**
* destroy array list for hash
...
...
@@ -189,7 +189,7 @@ void taosArrayDestroyForHash(void* para);
* @param pArray
* @param fp
*/
void
taosArrayDestroyEx
(
SArray
*
pArray
,
void
(
*
fp
)(
void
*
));
void
taosArrayDestroyEx
(
SArray
*
*
pArray
,
void
(
*
fp
)(
void
*
));
/**
* sort the array
...
...
src/util/src/hash.c
浏览文件 @
22d59537
...
...
@@ -614,7 +614,7 @@ void taosHashCleanup(SHashObj *pHashObj) {
tfree
(
p
);
}
taosArrayDestroy
(
pHashObj
->
pMemBlock
);
taosArrayDestroy
(
&
pHashObj
->
pMemBlock
);
memset
(
pHashObj
,
0
,
sizeof
(
SHashObj
));
tfree
(
pHashObj
);
...
...
src/util/src/tarray.c
浏览文件 @
22d59537
...
...
@@ -279,10 +279,10 @@ void taosArrayClear(SArray* pArray) {
pArray
->
size
=
0
;
}
void
*
taosArrayDestroy
(
SArray
*
pArray
)
{
if
(
pArray
)
{
tfree
(
pArray
->
pData
);
tfree
(
pArray
);
void
*
taosArrayDestroy
(
SArray
*
*
pArray
)
{
if
(
*
pArray
)
{
tfree
(
(
*
pArray
)
->
pData
);
tfree
(
*
pArray
);
}
return
NULL
;
...
...
@@ -292,17 +292,16 @@ void taosArrayDestroyForHash(void* para) {
SArray
**
ppArray
=
(
SArray
**
)
para
;
if
(
ppArray
==
NULL
)
return
;
SArray
*
pArray
=
*
ppArray
;
if
(
pArray
)
{
tfree
(
pArray
->
pData
);
tfree
(
pArray
);
if
(
*
ppArray
)
{
tfree
((
*
ppArray
)
->
pData
);
tfree
(
*
ppArray
);
}
return
;
}
void
taosArrayDestroyEx
(
SArray
*
pArray
,
void
(
*
fp
)(
void
*
))
{
if
(
pArray
==
NULL
)
{
void
taosArrayDestroyEx
(
SArray
*
*
pArray
,
void
(
*
fp
)(
void
*
))
{
if
(
*
pArray
==
NULL
)
{
return
;
}
...
...
@@ -311,8 +310,8 @@ void taosArrayDestroyEx(SArray* pArray, void (*fp)(void*)) {
return
;
}
for
(
int32_t
i
=
0
;
i
<
pArray
->
size
;
++
i
)
{
fp
(
TARRAY_GET_ELEM
(
pArray
,
i
));
for
(
int32_t
i
=
0
;
i
<
(
*
pArray
)
->
size
;
++
i
)
{
fp
(
TARRAY_GET_ELEM
(
*
pArray
,
i
));
}
taosArrayDestroy
(
pArray
);
...
...
src/util/src/tcache.c
浏览文件 @
22d59537
...
...
@@ -757,7 +757,7 @@ void* taosCacheTimedRefresh(void *handle) {
}
_end:
taosArrayDestroy
(
pCacheArrayList
);
taosArrayDestroy
(
&
pCacheArrayList
);
pCacheArrayList
=
NULL
;
pthread_mutex_destroy
(
&
guard
);
...
...
src/util/tests/skiplistTest.cpp
浏览文件 @
22d59537
...
...
@@ -300,7 +300,7 @@ void duplicatedKeyTest() {
SSkipListKey key;
SArray* nodes = tSkipListGet(pSkipList, (char*)(&i));
assert( taosArrayGetSize(nodes) == 5 );
taosArrayDestroy(nodes);
taosArrayDestroy(
&
nodes);
}
int32_t key = 101;
...
...
@@ -309,7 +309,7 @@ void duplicatedKeyTest() {
SArray* nodes = tSkipListGet(pSkipList, (char*)(&key));
assert( taosArrayGetSize(nodes) == 0 );
taosArrayDestroy(nodes);
taosArrayDestroy(
&
nodes);
key = 102;
SSkipListIterator* iter = tSkipListCreateIterFromVal(pSkipList, (char*)(&key), TSDB_DATA_TYPE_INT, TSDB_ORDER_ASC);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录