Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
93642189
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看板
提交
93642189
编写于
5月 21, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mem leak
上级
71365eb5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
50 addition
and
47 deletion
+50
-47
include/common/tmsg.h
include/common/tmsg.h
+4
-6
source/client/src/clientHb.c
source/client/src/clientHb.c
+23
-22
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+4
-3
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+6
-3
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+5
-13
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+3
-0
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+4
-0
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+1
-0
未找到文件。
include/common/tmsg.h
浏览文件 @
93642189
...
@@ -1987,19 +1987,16 @@ static FORCE_INLINE void tFreeClientHbReq(void* pReq) {
...
@@ -1987,19 +1987,16 @@ static FORCE_INLINE void tFreeClientHbReq(void* pReq) {
if
(
req
->
info
)
{
if
(
req
->
info
)
{
tFreeReqKvHash
(
req
->
info
);
tFreeReqKvHash
(
req
->
info
);
taosHashCleanup
(
req
->
info
);
taosHashCleanup
(
req
->
info
);
req
->
info
=
NULL
;
}
}
}
}
int32_t
tSerializeSClientHbBatchReq
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchReq
*
pReq
);
int32_t
tSerializeSClientHbBatchReq
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchReq
*
pReq
);
int32_t
tDeserializeSClientHbBatchReq
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchReq
*
pReq
);
int32_t
tDeserializeSClientHbBatchReq
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchReq
*
pReq
);
static
FORCE_INLINE
void
tFreeClientHbBatchReq
(
void
*
pReq
,
bool
deep
)
{
static
FORCE_INLINE
void
tFreeClientHbBatchReq
(
void
*
pReq
)
{
SClientHbBatchReq
*
req
=
(
SClientHbBatchReq
*
)
pReq
;
SClientHbBatchReq
*
req
=
(
SClientHbBatchReq
*
)
pReq
;
if
(
deep
)
{
taosArrayDestroyEx
(
req
->
reqs
,
tFreeClientHbReq
);
taosArrayDestroyEx
(
req
->
reqs
,
tFreeClientHbReq
);
}
else
{
taosArrayDestroy
(
req
->
reqs
);
}
taosMemoryFree
(
pReq
);
taosMemoryFree
(
pReq
);
}
}
...
@@ -2023,6 +2020,7 @@ static FORCE_INLINE void tFreeClientHbBatchRsp(void* pRsp) {
...
@@ -2023,6 +2020,7 @@ static FORCE_INLINE void tFreeClientHbBatchRsp(void* pRsp) {
int32_t
tSerializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tSerializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
const
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tDeserializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchRsp
*
pBatchRsp
);
int32_t
tDeserializeSClientHbBatchRsp
(
void
*
buf
,
int32_t
bufLen
,
SClientHbBatchRsp
*
pBatchRsp
);
void
tFreeSClientHbBatchRsp
(
SClientHbBatchRsp
*
pBatchRsp
);
static
FORCE_INLINE
int32_t
tEncodeSKv
(
SEncoder
*
pEncoder
,
const
SKv
*
pKv
)
{
static
FORCE_INLINE
int32_t
tEncodeSKv
(
SEncoder
*
pEncoder
,
const
SKv
*
pKv
)
{
if
(
tEncodeI32
(
pEncoder
,
pKv
->
key
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
pKv
->
key
)
<
0
)
return
-
1
;
...
...
source/client/src/clientHb.c
浏览文件 @
93642189
...
@@ -394,6 +394,10 @@ int32_t hbGetExpiredUserInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, S
...
@@ -394,6 +394,10 @@ int32_t hbGetExpiredUserInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, S
tscDebug
(
"hb got %d expired users, valueLen:%d"
,
userNum
,
kv
.
valueLen
);
tscDebug
(
"hb got %d expired users, valueLen:%d"
,
userNum
,
kv
.
valueLen
);
if
(
NULL
==
req
->
info
)
{
req
->
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
}
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -429,6 +433,10 @@ int32_t hbGetExpiredDBInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SCl
...
@@ -429,6 +433,10 @@ int32_t hbGetExpiredDBInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SCl
tscDebug
(
"hb got %d expired db, valueLen:%d"
,
dbNum
,
kv
.
valueLen
);
tscDebug
(
"hb got %d expired db, valueLen:%d"
,
dbNum
,
kv
.
valueLen
);
if
(
NULL
==
req
->
info
)
{
req
->
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
}
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -463,6 +471,10 @@ int32_t hbGetExpiredStbInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SC
...
@@ -463,6 +471,10 @@ int32_t hbGetExpiredStbInfo(SClientHbKey *connKey, struct SCatalog *pCatalog, SC
tscDebug
(
"hb got %d expired stb, valueLen:%d"
,
stbNum
,
kv
.
valueLen
);
tscDebug
(
"hb got %d expired stb, valueLen:%d"
,
stbNum
,
kv
.
valueLen
);
if
(
NULL
==
req
->
info
)
{
req
->
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
}
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
taosHashPut
(
req
->
info
,
&
kv
.
key
,
sizeof
(
kv
.
key
),
&
kv
,
sizeof
(
kv
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -511,16 +523,6 @@ static FORCE_INLINE void hbMgrInitHandle() {
...
@@ -511,16 +523,6 @@ static FORCE_INLINE void hbMgrInitHandle() {
hbMgrInitMqHbHandle
();
hbMgrInitMqHbHandle
();
}
}
void
hbFreeReq
(
void
*
req
)
{
SClientHbReq
*
pReq
=
(
SClientHbReq
*
)
req
;
tFreeReqKvHash
(
pReq
->
info
);
}
void
hbClearClientHbReq
(
SClientHbReq
*
pReq
)
{
pReq
->
query
=
NULL
;
pReq
->
info
=
NULL
;
}
SClientHbBatchReq
*
hbGatherAllInfo
(
SAppHbMgr
*
pAppHbMgr
)
{
SClientHbBatchReq
*
hbGatherAllInfo
(
SAppHbMgr
*
pAppHbMgr
)
{
SClientHbBatchReq
*
pBatchReq
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientHbBatchReq
));
SClientHbBatchReq
*
pBatchReq
=
taosMemoryCalloc
(
1
,
sizeof
(
SClientHbBatchReq
));
if
(
pBatchReq
==
NULL
)
{
if
(
pBatchReq
==
NULL
)
{
...
@@ -535,6 +537,8 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
...
@@ -535,6 +537,8 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
while
(
pIter
!=
NULL
)
{
while
(
pIter
!=
NULL
)
{
SClientHbReq
*
pOneReq
=
pIter
;
SClientHbReq
*
pOneReq
=
pIter
;
pOneReq
=
taosArrayPush
(
pBatchReq
->
reqs
,
pOneReq
);
SHbConnInfo
*
info
=
taosHashGet
(
pAppHbMgr
->
connInfo
,
&
pOneReq
->
connKey
,
sizeof
(
SClientHbKey
));
SHbConnInfo
*
info
=
taosHashGet
(
pAppHbMgr
->
connInfo
,
&
pOneReq
->
connKey
,
sizeof
(
SClientHbKey
));
if
(
info
)
{
if
(
info
)
{
code
=
(
*
clientHbMgr
.
reqHandle
[
pOneReq
->
connKey
.
connType
])(
&
pOneReq
->
connKey
,
info
->
param
,
pOneReq
);
code
=
(
*
clientHbMgr
.
reqHandle
[
pOneReq
->
connKey
.
connType
])(
&
pOneReq
->
connKey
,
info
->
param
,
pOneReq
);
...
@@ -544,7 +548,6 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
...
@@ -544,7 +548,6 @@ SClientHbBatchReq *hbGatherAllInfo(SAppHbMgr *pAppHbMgr) {
}
}
}
}
taosArrayPush
(
pBatchReq
->
reqs
,
pOneReq
);
//hbClearClientHbReq(pOneReq);
//hbClearClientHbReq(pOneReq);
pIter
=
taosHashIterate
(
pAppHbMgr
->
activeInfo
,
pIter
);
pIter
=
taosHashIterate
(
pAppHbMgr
->
activeInfo
,
pIter
);
...
@@ -601,8 +604,8 @@ static void *hbThreadFunc(void *param) {
...
@@ -601,8 +604,8 @@ static void *hbThreadFunc(void *param) {
void
*
buf
=
taosMemoryMalloc
(
tlen
);
void
*
buf
=
taosMemoryMalloc
(
tlen
);
if
(
buf
==
NULL
)
{
if
(
buf
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tFreeClientHbBatchReq
(
pReq
,
false
);
tFreeClientHbBatchReq
(
pReq
);
hbClearReqInfo
(
pAppHbMgr
);
//
hbClearReqInfo(pAppHbMgr);
break
;
break
;
}
}
...
@@ -611,8 +614,8 @@ static void *hbThreadFunc(void *param) {
...
@@ -611,8 +614,8 @@ static void *hbThreadFunc(void *param) {
if
(
pInfo
==
NULL
)
{
if
(
pInfo
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tFreeClientHbBatchReq
(
pReq
,
false
);
tFreeClientHbBatchReq
(
pReq
);
hbClearReqInfo
(
pAppHbMgr
);
//
hbClearReqInfo(pAppHbMgr);
taosMemoryFree
(
buf
);
taosMemoryFree
(
buf
);
break
;
break
;
}
}
...
@@ -628,8 +631,8 @@ static void *hbThreadFunc(void *param) {
...
@@ -628,8 +631,8 @@ static void *hbThreadFunc(void *param) {
int64_t
transporterId
=
0
;
int64_t
transporterId
=
0
;
SEpSet
epSet
=
getEpSet_s
(
&
pAppInstInfo
->
mgmtEp
);
SEpSet
epSet
=
getEpSet_s
(
&
pAppInstInfo
->
mgmtEp
);
asyncSendMsgToServer
(
pAppInstInfo
->
pTransporter
,
&
epSet
,
&
transporterId
,
pInfo
);
asyncSendMsgToServer
(
pAppInstInfo
->
pTransporter
,
&
epSet
,
&
transporterId
,
pInfo
);
tFreeClientHbBatchReq
(
pReq
,
false
);
tFreeClientHbBatchReq
(
pReq
);
hbClearReqInfo
(
pAppHbMgr
);
//
hbClearReqInfo(pAppHbMgr);
atomic_add_fetch_32
(
&
pAppHbMgr
->
reportCnt
,
1
);
atomic_add_fetch_32
(
&
pAppHbMgr
->
reportCnt
,
1
);
}
}
...
@@ -721,8 +724,7 @@ void appHbMgrCleanup(void) {
...
@@ -721,8 +724,7 @@ void appHbMgrCleanup(void) {
void
*
pIter
=
taosHashIterate
(
pTarget
->
activeInfo
,
NULL
);
void
*
pIter
=
taosHashIterate
(
pTarget
->
activeInfo
,
NULL
);
while
(
pIter
!=
NULL
)
{
while
(
pIter
!=
NULL
)
{
SClientHbReq
*
pOneReq
=
pIter
;
SClientHbReq
*
pOneReq
=
pIter
;
hbFreeReq
(
pOneReq
);
tFreeClientHbReq
(
pOneReq
);
taosHashCleanup
(
pOneReq
->
info
);
pIter
=
taosHashIterate
(
pTarget
->
activeInfo
,
pIter
);
pIter
=
taosHashIterate
(
pTarget
->
activeInfo
,
pIter
);
}
}
taosHashCleanup
(
pTarget
->
activeInfo
);
taosHashCleanup
(
pTarget
->
activeInfo
);
...
@@ -782,7 +784,7 @@ int hbRegisterConnImpl(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, SHbConnInfo *
...
@@ -782,7 +784,7 @@ int hbRegisterConnImpl(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, SHbConnInfo *
}
}
SClientHbReq
hbReq
=
{
0
};
SClientHbReq
hbReq
=
{
0
};
hbReq
.
connKey
=
connKey
;
hbReq
.
connKey
=
connKey
;
hbReq
.
info
=
taosHashInit
(
64
,
hbKeyHashFunc
,
1
,
HASH_ENTRY_LOCK
);
//
hbReq.info = taosHashInit(64, hbKeyHashFunc, 1, HASH_ENTRY_LOCK);
taosHashPut
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
),
&
hbReq
,
sizeof
(
SClientHbReq
));
taosHashPut
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
),
&
hbReq
,
sizeof
(
SClientHbReq
));
...
@@ -823,8 +825,7 @@ int hbRegisterConn(SAppHbMgr *pAppHbMgr, int64_t tscRefId, int64_t clusterId, in
...
@@ -823,8 +825,7 @@ int hbRegisterConn(SAppHbMgr *pAppHbMgr, int64_t tscRefId, int64_t clusterId, in
void
hbDeregisterConn
(
SAppHbMgr
*
pAppHbMgr
,
SClientHbKey
connKey
)
{
void
hbDeregisterConn
(
SAppHbMgr
*
pAppHbMgr
,
SClientHbKey
connKey
)
{
SClientHbReq
*
pReq
=
taosHashGet
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
SClientHbReq
*
pReq
=
taosHashGet
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
if
(
pReq
)
{
if
(
pReq
)
{
hbFreeReq
(
pReq
);
tFreeClientHbReq
(
pReq
);
taosHashCleanup
(
pReq
->
info
);
taosHashRemove
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
taosHashRemove
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
}
}
...
...
source/client/src/clientImpl.c
浏览文件 @
93642189
...
@@ -387,7 +387,7 @@ _return:
...
@@ -387,7 +387,7 @@ _return:
}
}
void
freeRequestRes
(
SRequestObj
*
pRequest
,
void
*
res
)
{
void
freeRequestRes
(
SRequestObj
*
pRequest
,
void
*
res
)
{
if
(
NULL
==
res
)
{
if
(
NULL
==
pRequest
||
NULL
==
res
)
{
return
;
return
;
}
}
...
@@ -435,12 +435,13 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, int32_t code
...
@@ -435,12 +435,13 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, int32_t code
if
(
NULL
!=
pRequest
&&
TSDB_CODE_SUCCESS
!=
code
)
{
if
(
NULL
!=
pRequest
&&
TSDB_CODE_SUCCESS
!=
code
)
{
pRequest
->
code
=
terrno
;
pRequest
->
code
=
terrno
;
freeRequestRes
(
pRequest
,
pRes
);
pRes
=
NULL
;
}
}
if
(
res
)
{
if
(
res
)
{
*
res
=
pRes
;
*
res
=
pRes
;
}
else
{
freeRequestRes
(
pRequest
,
pRes
);
pRes
=
NULL
;
}
}
return
pRequest
;
return
pRequest
;
...
...
source/client/src/clientStmt.c
浏览文件 @
93642189
...
@@ -800,6 +800,7 @@ int stmtExec(TAOS_STMT* stmt) {
...
@@ -800,6 +800,7 @@ int stmtExec(TAOS_STMT* stmt) {
if
(
code
)
{
if
(
code
)
{
pStmt
->
exec
.
pRequest
->
code
=
code
;
pStmt
->
exec
.
pRequest
->
code
=
code
;
}
else
{
}
else
{
tFreeSSubmitRsp
(
pRsp
);
STMT_ERR_RET
(
stmtResetStmt
(
pStmt
));
STMT_ERR_RET
(
stmtResetStmt
(
pStmt
));
STMT_ERR_RET
(
TSDB_CODE_NEED_RETRY
);
STMT_ERR_RET
(
TSDB_CODE_NEED_RETRY
);
}
}
...
@@ -817,11 +818,13 @@ _return:
...
@@ -817,11 +818,13 @@ _return:
if
(
TSDB_CODE_SUCCESS
==
code
&&
autoCreateTbl
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
autoCreateTbl
)
{
if
(
NULL
==
pRsp
)
{
if
(
NULL
==
pRsp
)
{
tscError
(
"no submit resp got for auto create table"
);
tscError
(
"no submit resp got for auto create table"
);
STMT_ERR_RET
(
TSDB_CODE_TSC_APP_ERROR
);
code
=
TSDB_CODE_TSC_APP_ERROR
;
}
else
{
code
=
stmtUpdateTableUid
(
pStmt
,
pRsp
);
}
}
STMT_ERR_RET
(
stmtUpdateTableUid
(
pStmt
,
pRsp
));
}
}
tFreeSSubmitRsp
(
pRsp
);
++
pStmt
->
sql
.
runTimes
;
++
pStmt
->
sql
.
runTimes
;
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
93642189
...
@@ -128,7 +128,8 @@ static SConnObj *mndCreateConn(SMnode *pMnode, const char *user, int8_t connType
...
@@ -128,7 +128,8 @@ static SConnObj *mndCreateConn(SMnode *pMnode, const char *user, int8_t connType
}
}
static
void
mndFreeConn
(
SConnObj
*
pConn
)
{
static
void
mndFreeConn
(
SConnObj
*
pConn
)
{
taosMemoryFreeClear
(
pConn
->
pQueries
);
taosArrayDestroyEx
(
pConn
->
pQueries
,
tFreeClientHbQueryDesc
);
mTrace
(
"conn:%u, is destroyed, data:%p"
,
pConn
->
id
,
pConn
);
mTrace
(
"conn:%u, is destroyed, data:%p"
,
pConn
->
id
,
pConn
);
}
}
...
@@ -396,6 +397,7 @@ static int32_t mndProcessQueryHeartBeat(SMnode *pMnode, SRpcMsg *pMsg, SClientHb
...
@@ -396,6 +397,7 @@ static int32_t mndProcessQueryHeartBeat(SMnode *pMnode, SRpcMsg *pMsg, SClientHb
if
(
NULL
==
hbRsp
.
info
)
{
if
(
NULL
==
hbRsp
.
info
)
{
mError
(
"taosArrayInit %d rsp kv failed"
,
kvNum
);
mError
(
"taosArrayInit %d rsp kv failed"
,
kvNum
);
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
tFreeClientHbRsp
(
&
hbRsp
);
return
-
1
;
return
-
1
;
}
}
...
@@ -453,6 +455,7 @@ static int32_t mndProcessHeartBeatReq(SRpcMsg *pReq) {
...
@@ -453,6 +455,7 @@ static int32_t mndProcessHeartBeatReq(SRpcMsg *pReq) {
SClientHbBatchReq
batchReq
=
{
0
};
SClientHbBatchReq
batchReq
=
{
0
};
if
(
tDeserializeSClientHbBatchReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
batchReq
)
!=
0
)
{
if
(
tDeserializeSClientHbBatchReq
(
pReq
->
pCont
,
pReq
->
contLen
,
&
batchReq
)
!=
0
)
{
taosArrayDestroyEx
(
batchReq
.
reqs
,
tFreeClientHbReq
);
terrno
=
TSDB_CODE_INVALID_MSG
;
terrno
=
TSDB_CODE_INVALID_MSG
;
return
-
1
;
return
-
1
;
}
}
...
@@ -479,18 +482,7 @@ static int32_t mndProcessHeartBeatReq(SRpcMsg *pReq) {
...
@@ -479,18 +482,7 @@ static int32_t mndProcessHeartBeatReq(SRpcMsg *pReq) {
void
*
buf
=
rpcMallocCont
(
tlen
);
void
*
buf
=
rpcMallocCont
(
tlen
);
tSerializeSClientHbBatchRsp
(
buf
,
tlen
,
&
batchRsp
);
tSerializeSClientHbBatchRsp
(
buf
,
tlen
,
&
batchRsp
);
int32_t
rspNum
=
(
int32_t
)
taosArrayGetSize
(
batchRsp
.
rsps
);
tFreeClientHbBatchRsp
(
&
batchRsp
);
for
(
int32_t
i
=
0
;
i
<
rspNum
;
++
i
)
{
SClientHbRsp
*
rsp
=
taosArrayGet
(
batchRsp
.
rsps
,
i
);
int32_t
kvNum
=
(
rsp
->
info
)
?
taosArrayGetSize
(
rsp
->
info
)
:
0
;
for
(
int32_t
n
=
0
;
n
<
kvNum
;
++
n
)
{
SKv
*
kv
=
taosArrayGet
(
rsp
->
info
,
n
);
taosMemoryFreeClear
(
kv
->
value
);
}
taosArrayDestroy
(
rsp
->
info
);
}
taosArrayDestroy
(
batchRsp
.
rsps
);
pReq
->
info
.
rspLen
=
tlen
;
pReq
->
info
.
rspLen
=
tlen
;
pReq
->
info
.
rsp
=
buf
;
pReq
->
info
.
rsp
=
buf
;
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
93642189
...
@@ -1642,6 +1642,8 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
...
@@ -1642,6 +1642,8 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
if
(
pStbVersion
->
sversion
!=
metaRsp
.
sversion
)
{
if
(
pStbVersion
->
sversion
!=
metaRsp
.
sversion
)
{
taosArrayPush
(
batchMetaRsp
.
pArray
,
&
metaRsp
);
taosArrayPush
(
batchMetaRsp
.
pArray
,
&
metaRsp
);
}
else
{
tFreeSTableMetaRsp
(
&
metaRsp
);
}
}
}
}
...
@@ -1660,6 +1662,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
...
@@ -1660,6 +1662,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *pStbVersions, int
}
}
tSerializeSTableMetaBatchRsp
(
pRsp
,
rspLen
,
&
batchMetaRsp
);
tSerializeSTableMetaBatchRsp
(
pRsp
,
rspLen
,
&
batchMetaRsp
);
tFreeSTableMetaBatchRsp
(
&
batchMetaRsp
);
*
ppRsp
=
pRsp
;
*
ppRsp
=
pRsp
;
*
pRspLen
=
rspLen
;
*
pRspLen
=
rspLen
;
return
0
;
return
0
;
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
93642189
...
@@ -1085,6 +1085,10 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
...
@@ -1085,6 +1085,10 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
// no data in the sql string anymore.
// no data in the sql string anymore.
if
(
sToken
.
n
==
0
)
{
if
(
sToken
.
n
==
0
)
{
if
(
sToken
.
type
&&
pCxt
->
pSql
[
0
])
{
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
"invalid charactor in SQL"
,
sToken
.
z
);
}
if
(
0
==
pCxt
->
totalNum
&&
(
!
TSDB_QUERY_HAS_TYPE
(
pCxt
->
pOutput
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
)))
{
if
(
0
==
pCxt
->
totalNum
&&
(
!
TSDB_QUERY_HAS_TYPE
(
pCxt
->
pOutput
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
)))
{
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"no data in sql"
);
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"no data in sql"
);
}
}
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
93642189
...
@@ -704,6 +704,7 @@ SToken tStrGetToken(const char* str, int32_t* i, bool isPrevOptr) {
...
@@ -704,6 +704,7 @@ SToken tStrGetToken(const char* str, int32_t* i, bool isPrevOptr) {
if
(
t0
.
type
==
TK_NK_SEMI
)
{
if
(
t0
.
type
==
TK_NK_SEMI
)
{
t0
.
n
=
0
;
t0
.
n
=
0
;
t0
.
type
=
0
;
return
t0
;
return
t0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录