Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2e75de83
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
2e75de83
编写于
12月 01, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix submit response message handling
上级
70c133a1
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
84 addition
and
88 deletion
+84
-88
include/common/tmsg.h
include/common/tmsg.h
+0
-1
include/libs/parser/parser.h
include/libs/parser/parser.h
+2
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+8
-33
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+7
-7
source/common/src/tmsg.c
source/common/src/tmsg.c
+16
-10
source/libs/parser/src/parInsertStmt.c
source/libs/parser/src/parInsertStmt.c
+4
-4
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+12
-1
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+1
-1
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+34
-31
未找到文件。
include/common/tmsg.h
浏览文件 @
2e75de83
...
@@ -3234,7 +3234,6 @@ void tDestroySSubmitTbData(SSubmitTbData* pTbData, int32_t flag);
...
@@ -3234,7 +3234,6 @@ void tDestroySSubmitTbData(SSubmitTbData* pTbData, int32_t flag);
void
tDestroySSubmitReq2
(
SSubmitReq2
*
pReq
,
int32_t
flag
);
void
tDestroySSubmitReq2
(
SSubmitReq2
*
pReq
,
int32_t
flag
);
typedef
struct
{
typedef
struct
{
int32_t
code
;
int32_t
affectedRows
;
int32_t
affectedRows
;
SArray
*
aCreateTbRsp
;
// SArray<SVCreateTbRsp>
SArray
*
aCreateTbRsp
;
// SArray<SVCreateTbRsp>
}
SSubmitRsp2
;
}
SSubmitRsp2
;
...
...
include/libs/parser/parser.h
浏览文件 @
2e75de83
...
@@ -104,6 +104,8 @@ void destroyBoundColumnInfo(void* pBoundInfo);
...
@@ -104,6 +104,8 @@ void destroyBoundColumnInfo(void* pBoundInfo);
int32_t
qCreateSName
(
SName
*
pName
,
const
char
*
pTableName
,
int32_t
acctId
,
char
*
dbName
,
char
*
msgBuf
,
int32_t
qCreateSName
(
SName
*
pName
,
const
char
*
pTableName
,
int32_t
acctId
,
char
*
dbName
,
char
*
msgBuf
,
int32_t
msgBufLen
);
int32_t
msgBufLen
);
void
qDestroyBoundColInfo
(
void
*
pInfo
);
void
*
smlInitHandle
(
SQuery
*
pQuery
);
void
*
smlInitHandle
(
SQuery
*
pQuery
);
void
smlDestroyHandle
(
void
*
pHandle
);
void
smlDestroyHandle
(
void
*
pHandle
);
int32_t
smlBindData
(
void
*
handle
,
SArray
*
tags
,
SArray
*
colsSchema
,
SArray
*
cols
,
bool
format
,
STableMeta
*
pTableMeta
,
int32_t
smlBindData
(
void
*
handle
,
SArray
*
tags
,
SArray
*
colsSchema
,
SArray
*
cols
,
bool
format
,
STableMeta
*
pTableMeta
,
...
...
source/client/src/clientImpl.c
浏览文件 @
2e75de83
...
@@ -734,46 +734,21 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList
...
@@ -734,46 +734,21 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList
}
}
int32_t
handleSubmitExecRes
(
SRequestObj
*
pRequest
,
void
*
res
,
SCatalog
*
pCatalog
,
SEpSet
*
epset
)
{
int32_t
handleSubmitExecRes
(
SRequestObj
*
pRequest
,
void
*
res
,
SCatalog
*
pCatalog
,
SEpSet
*
epset
)
{
int32_t
code
=
0
;
SArray
*
pArray
=
NULL
;
SArray
*
pArray
=
NULL
;
SSubmitRsp
*
pRsp
=
(
SSubmitRsp
*
)
res
;
SSubmitRsp
2
*
pRsp
=
(
SSubmitRsp2
*
)
res
;
if
(
pRsp
->
nBlocks
<=
0
)
{
if
(
NULL
==
pRsp
->
aCreateTbRsp
)
{
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
pArray
=
taosArrayInit
(
pRsp
->
nBlocks
,
sizeof
(
STbSVersion
));
int32_t
tbNum
=
taosArrayGetSize
(
pRsp
->
aCreateTbRsp
);
if
(
NULL
==
pArray
)
{
for
(
int32_t
i
=
0
;
i
<
tbNum
;
++
i
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
SVCreateTbRsp
*
pTbRsp
=
(
SVCreateTbRsp
*
)
taosArrayGet
(
pRsp
->
aCreateTbRsp
,
i
);
return
TSDB_CODE_OUT_OF_MEMORY
;
if
(
pTbRsp
->
pMeta
)
{
}
handleCreateTbExecRes
(
pTbRsp
->
pMeta
,
pCatalog
);
for
(
int32_t
i
=
0
;
i
<
pRsp
->
nBlocks
;
++
i
)
{
SSubmitBlkRsp
*
blk
=
pRsp
->
pBlocks
+
i
;
if
(
blk
->
pMeta
)
{
handleCreateTbExecRes
(
blk
->
pMeta
,
pCatalog
);
tFreeSTableMetaRsp
(
blk
->
pMeta
);
taosMemoryFreeClear
(
blk
->
pMeta
);
}
if
(
NULL
==
blk
->
tblFName
||
0
==
blk
->
tblFName
[
0
])
{
continue
;
}
}
STbSVersion
tbSver
=
{.
tbFName
=
blk
->
tblFName
,
.
sver
=
blk
->
sver
};
taosArrayPush
(
pArray
,
&
tbSver
);
}
}
SRequestConnInfo
conn
=
{.
pTrans
=
pRequest
->
pTscObj
->
pAppInfo
->
pTransporter
,
return
TSDB_CODE_SUCCESS
;
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
*
epset
};
code
=
catalogChkTbMetaVersion
(
pCatalog
,
&
conn
,
pArray
);
_return:
taosArrayDestroy
(
pArray
);
return
code
;
}
}
int32_t
handleQueryExecRes
(
SRequestObj
*
pRequest
,
void
*
res
,
SCatalog
*
pCatalog
,
SEpSet
*
epset
)
{
int32_t
handleQueryExecRes
(
SRequestObj
*
pRequest
,
void
*
res
,
SCatalog
*
pCatalog
,
SEpSet
*
epset
)
{
...
...
source/client/src/clientStmt.c
浏览文件 @
2e75de83
...
@@ -273,7 +273,7 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
...
@@ -273,7 +273,7 @@ int32_t stmtCleanBindInfo(STscStmt* pStmt) {
pStmt
->
bInfo
.
tbName
[
0
]
=
0
;
pStmt
->
bInfo
.
tbName
[
0
]
=
0
;
pStmt
->
bInfo
.
tbFName
[
0
]
=
0
;
pStmt
->
bInfo
.
tbFName
[
0
]
=
0
;
if
(
!
pStmt
->
bInfo
.
tagsCached
)
{
if
(
!
pStmt
->
bInfo
.
tagsCached
)
{
destroyBoundColumn
Info
(
pStmt
->
bInfo
.
boundTags
);
qDestroyBoundCol
Info
(
pStmt
->
bInfo
.
boundTags
);
taosMemoryFreeClear
(
pStmt
->
bInfo
.
boundTags
);
taosMemoryFreeClear
(
pStmt
->
bInfo
.
boundTags
);
}
}
memset
(
pStmt
->
bInfo
.
stbFName
,
0
,
TSDB_TABLE_FNAME_LEN
);
memset
(
pStmt
->
bInfo
.
stbFName
,
0
,
TSDB_TABLE_FNAME_LEN
);
...
@@ -293,12 +293,14 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
...
@@ -293,12 +293,14 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
char
*
key
=
taosHashGetKey
(
pIter
,
&
keyLen
);
char
*
key
=
taosHashGetKey
(
pIter
,
&
keyLen
);
STableMeta
*
pMeta
=
qGetTableMetaInDataBlock
(
pBlocks
);
STableMeta
*
pMeta
=
qGetTableMetaInDataBlock
(
pBlocks
);
/*
if (keepTable && (strlen(pStmt->bInfo.tbFName) == keyLen) && strncmp(pStmt->bInfo.tbFName, key, keyLen) == 0) {
if (keepTable && (strlen(pStmt->bInfo.tbFName) == keyLen) && strncmp(pStmt->bInfo.tbFName, key, keyLen) == 0) {
STMT_ERR_RET(qResetStmtDataBlock(pBlocks, false));
STMT_ERR_RET(qResetStmtDataBlock(pBlocks, false));
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
pIter = taosHashIterate(pStmt->exec.pBlockHash, pIter);
continue;
continue;
}
}
*/
qDestroyStmtDataBlock
(
pBlocks
);
qDestroyStmtDataBlock
(
pBlocks
);
taosHashRemove
(
pStmt
->
exec
.
pBlockHash
,
key
,
keyLen
);
taosHashRemove
(
pStmt
->
exec
.
pBlockHash
,
key
,
keyLen
);
...
@@ -308,13 +310,11 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
...
@@ -308,13 +310,11 @@ int32_t stmtCleanExecInfo(STscStmt* pStmt, bool keepTable, bool deepClean) {
pStmt
->
exec
.
autoCreateTbl
=
false
;
pStmt
->
exec
.
autoCreateTbl
=
false
;
if
(
keepTable
)
{
if
(
!
keepTable
)
{
return
TSDB_CODE_SUCCESS
;
taosHashCleanup
(
pStmt
->
exec
.
pBlockHash
);
pStmt
->
exec
.
pBlockHash
=
NULL
;
}
}
taosHashCleanup
(
pStmt
->
exec
.
pBlockHash
);
pStmt
->
exec
.
pBlockHash
=
NULL
;
STMT_ERR_RET
(
stmtCleanBindInfo
(
pStmt
));
STMT_ERR_RET
(
stmtCleanBindInfo
(
pStmt
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -334,7 +334,7 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
...
@@ -334,7 +334,7 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
SStmtTableCache
*
pCache
=
(
SStmtTableCache
*
)
pIter
;
SStmtTableCache
*
pCache
=
(
SStmtTableCache
*
)
pIter
;
qDestroyStmtDataBlock
(
pCache
->
pDataCtx
);
qDestroyStmtDataBlock
(
pCache
->
pDataCtx
);
destroyBoundColumn
Info
(
pCache
->
boundTags
);
qDestroyBoundCol
Info
(
pCache
->
boundTags
);
taosMemoryFreeClear
(
pCache
->
boundTags
);
taosMemoryFreeClear
(
pCache
->
boundTags
);
pIter
=
taosHashIterate
(
pStmt
->
sql
.
pTableCache
,
pIter
);
pIter
=
taosHashIterate
(
pStmt
->
sql
.
pTableCache
,
pIter
);
...
...
source/common/src/tmsg.c
浏览文件 @
2e75de83
...
@@ -6876,7 +6876,6 @@ void tDestroySSubmitReq2(SSubmitReq2 *pReq, int32_t flag) {
...
@@ -6876,7 +6876,6 @@ void tDestroySSubmitReq2(SSubmitReq2 *pReq, int32_t flag) {
int32_t
tEncodeSSubmitRsp2
(
SEncoder
*
pCoder
,
const
SSubmitRsp2
*
pRsp
)
{
int32_t
tEncodeSSubmitRsp2
(
SEncoder
*
pCoder
,
const
SSubmitRsp2
*
pRsp
)
{
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tStartEncode
(
pCoder
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pCoder
,
pRsp
->
code
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pCoder
,
pRsp
->
affectedRows
)
<
0
)
return
-
1
;
if
(
tEncodeI32v
(
pCoder
,
pRsp
->
affectedRows
)
<
0
)
return
-
1
;
if
(
tEncodeU64v
(
pCoder
,
taosArrayGetSize
(
pRsp
->
aCreateTbRsp
))
<
0
)
return
-
1
;
if
(
tEncodeU64v
(
pCoder
,
taosArrayGetSize
(
pRsp
->
aCreateTbRsp
))
<
0
)
return
-
1
;
...
@@ -6899,11 +6898,6 @@ int32_t tDecodeSSubmitRsp2(SDecoder *pCoder, SSubmitRsp2 *pRsp) {
...
@@ -6899,11 +6898,6 @@ int32_t tDecodeSSubmitRsp2(SDecoder *pCoder, SSubmitRsp2 *pRsp) {
goto
_exit
;
goto
_exit
;
}
}
if
(
tDecodeI32v
(
pCoder
,
&
pRsp
->
code
)
<
0
)
{
code
=
TSDB_CODE_INVALID_MSG
;
goto
_exit
;
}
if
(
tDecodeI32v
(
pCoder
,
&
pRsp
->
affectedRows
)
<
0
)
{
if
(
tDecodeI32v
(
pCoder
,
&
pRsp
->
affectedRows
)
<
0
)
{
code
=
TSDB_CODE_INVALID_MSG
;
code
=
TSDB_CODE_INVALID_MSG
;
goto
_exit
;
goto
_exit
;
...
@@ -6943,7 +6937,22 @@ _exit:
...
@@ -6943,7 +6937,22 @@ _exit:
}
}
void
tDestroySSubmitRsp2
(
SSubmitRsp2
*
pRsp
,
int32_t
flag
)
{
void
tDestroySSubmitRsp2
(
SSubmitRsp2
*
pRsp
,
int32_t
flag
)
{
if
(
TSDB_MSG_FLG_ENCODE
)
{
if
(
NULL
==
pRsp
)
{
return
;
}
if
(
flag
&
TSDB_MSG_FLG_ENCODE
)
{
if
(
pRsp
->
aCreateTbRsp
)
{
int32_t
nCreateTbRsp
=
TARRAY_SIZE
(
pRsp
->
aCreateTbRsp
);
SVCreateTbRsp
*
aCreateTbRsp
=
TARRAY_DATA
(
pRsp
->
aCreateTbRsp
);
for
(
int32_t
i
=
0
;
i
<
nCreateTbRsp
;
++
i
)
{
if
(
aCreateTbRsp
[
i
].
pMeta
)
{
taosMemoryFree
(
aCreateTbRsp
[
i
].
pMeta
);
}
}
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
}
}
else
if
(
flag
&
TSDB_MSG_FLG_DECODE
)
{
if
(
pRsp
->
aCreateTbRsp
)
{
if
(
pRsp
->
aCreateTbRsp
)
{
int32_t
nCreateTbRsp
=
TARRAY_SIZE
(
pRsp
->
aCreateTbRsp
);
int32_t
nCreateTbRsp
=
TARRAY_SIZE
(
pRsp
->
aCreateTbRsp
);
SVCreateTbRsp
*
aCreateTbRsp
=
TARRAY_DATA
(
pRsp
->
aCreateTbRsp
);
SVCreateTbRsp
*
aCreateTbRsp
=
TARRAY_DATA
(
pRsp
->
aCreateTbRsp
);
...
@@ -6954,8 +6963,5 @@ void tDestroySSubmitRsp2(SSubmitRsp2 *pRsp, int32_t flag) {
...
@@ -6954,8 +6963,5 @@ void tDestroySSubmitRsp2(SSubmitRsp2 *pRsp, int32_t flag) {
}
}
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
}
}
}
else
if
(
TSDB_MSG_FLG_DECODE
)
{
// TODO
taosArrayDestroy
(
pRsp
->
aCreateTbRsp
);
}
}
}
}
source/libs/parser/src/parInsertStmt.c
浏览文件 @
2e75de83
...
@@ -53,7 +53,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
...
@@ -53,7 +53,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
STableDataCxt
*
pDataBlock
=
(
STableDataCxt
*
)
pBlock
;
STableDataCxt
*
pDataBlock
=
(
STableDataCxt
*
)
pBlock
;
SMsgBuf
pBuf
=
{.
buf
=
msgBuf
,
.
len
=
msgBufLen
};
SMsgBuf
pBuf
=
{.
buf
=
msgBuf
,
.
len
=
msgBufLen
};
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
S
ParsedDataColInfo
*
tags
=
(
SParsedData
ColInfo
*
)
boundTags
;
S
BoundColInfo
*
tags
=
(
SBound
ColInfo
*
)
boundTags
;
if
(
NULL
==
tags
)
{
if
(
NULL
==
tags
)
{
return
TSDB_CODE_QRY_APP_ERROR
;
return
TSDB_CODE_QRY_APP_ERROR
;
}
}
...
@@ -79,7 +79,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
...
@@ -79,7 +79,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch
continue
;
continue
;
}
}
SSchema
*
pTagSchema
=
&
pSchema
[
tags
->
boundColumns
[
c
]];
SSchema
*
pTagSchema
=
&
pSchema
[
tags
->
pColIndex
[
c
]];
int32_t
colLen
=
pTagSchema
->
bytes
;
int32_t
colLen
=
pTagSchema
->
bytes
;
if
(
IS_VAR_DATA_TYPE
(
pTagSchema
->
type
))
{
if
(
IS_VAR_DATA_TYPE
(
pTagSchema
->
type
))
{
colLen
=
bind
[
c
].
length
[
0
];
colLen
=
bind
[
c
].
length
[
0
];
...
@@ -231,7 +231,7 @@ int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSc
...
@@ -231,7 +231,7 @@ int32_t buildBoundFields(int32_t numOfBound, int16_t* boundColumns, SSchema* pSc
int32_t
qBuildStmtTagFields
(
void
*
pBlock
,
void
*
boundTags
,
int32_t
*
fieldNum
,
TAOS_FIELD_E
**
fields
)
{
int32_t
qBuildStmtTagFields
(
void
*
pBlock
,
void
*
boundTags
,
int32_t
*
fieldNum
,
TAOS_FIELD_E
**
fields
)
{
STableDataCxt
*
pDataBlock
=
(
STableDataCxt
*
)
pBlock
;
STableDataCxt
*
pDataBlock
=
(
STableDataCxt
*
)
pBlock
;
S
ParsedDataColInfo
*
tags
=
(
SParsedData
ColInfo
*
)
boundTags
;
S
BoundColInfo
*
tags
=
(
SBound
ColInfo
*
)
boundTags
;
if
(
NULL
==
tags
)
{
if
(
NULL
==
tags
)
{
return
TSDB_CODE_QRY_APP_ERROR
;
return
TSDB_CODE_QRY_APP_ERROR
;
}
}
...
@@ -248,7 +248,7 @@ int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TA
...
@@ -248,7 +248,7 @@ int32_t qBuildStmtTagFields(void* pBlock, void* boundTags, int32_t* fieldNum, TA
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
CHECK_CODE
(
buildBoundFields
(
tags
->
numOfBound
,
tags
->
boundColumns
,
pSchema
,
fieldNum
,
fields
,
0
));
CHECK_CODE
(
buildBoundFields
(
tags
->
numOfBound
,
tags
->
pColIndex
,
pSchema
,
fieldNum
,
fields
,
0
));
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
2e75de83
...
@@ -194,6 +194,17 @@ void destroyBoundColumnInfo(void* pBoundInfo) {
...
@@ -194,6 +194,17 @@ void destroyBoundColumnInfo(void* pBoundInfo) {
taosMemoryFreeClear
(
pColList
->
colIdxInfo
);
taosMemoryFreeClear
(
pColList
->
colIdxInfo
);
}
}
void
qDestroyBoundColInfo
(
void
*
pInfo
)
{
if
(
NULL
==
pInfo
)
{
return
;
}
SBoundColInfo
*
pBoundInfo
=
(
SBoundColInfo
*
)
pInfo
;
taosMemoryFreeClear
(
pBoundInfo
->
pColIndex
);
}
static
int32_t
createDataBlock
(
size_t
defaultSize
,
int32_t
rowSize
,
int32_t
startOffset
,
STableMeta
*
pTableMeta
,
static
int32_t
createDataBlock
(
size_t
defaultSize
,
int32_t
rowSize
,
int32_t
startOffset
,
STableMeta
*
pTableMeta
,
STableDataBlocks
**
dataBlocks
)
{
STableDataBlocks
**
dataBlocks
)
{
STableDataBlocks
*
dataBuf
=
(
STableDataBlocks
*
)
taosMemoryCalloc
(
1
,
sizeof
(
STableDataBlocks
));
STableDataBlocks
*
dataBuf
=
(
STableDataBlocks
*
)
taosMemoryCalloc
(
1
,
sizeof
(
STableDataBlocks
));
...
@@ -999,7 +1010,7 @@ void insCheckTableDataOrder(STableDataCxt* pTableCxt, TSKEY tsKey) {
...
@@ -999,7 +1010,7 @@ void insCheckTableDataOrder(STableDataCxt* pTableCxt, TSKEY tsKey) {
return
;
return
;
}
}
static
void
destroyBoundColInfo
(
SBoundColInfo
*
pInfo
)
{
taosMemoryFreeClear
(
pInfo
->
pColIndex
);
}
void
destroyBoundColInfo
(
SBoundColInfo
*
pInfo
)
{
taosMemoryFreeClear
(
pInfo
->
pColIndex
);
}
static
int32_t
createTableDataCxt
(
STableMeta
*
pTableMeta
,
SVCreateTbReq
**
pCreateTbReq
,
STableDataCxt
**
pOutput
,
bool
colMode
)
{
static
int32_t
createTableDataCxt
(
STableMeta
*
pTableMeta
,
SVCreateTbReq
**
pCreateTbReq
,
STableDataCxt
**
pOutput
,
bool
colMode
)
{
STableDataCxt
*
pTableCxt
=
taosMemoryCalloc
(
1
,
sizeof
(
STableDataCxt
));
STableDataCxt
*
pTableCxt
=
taosMemoryCalloc
(
1
,
sizeof
(
STableDataCxt
));
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
2e75de83
...
@@ -243,7 +243,7 @@ void destroyQueryExecRes(SExecResult* pRes) {
...
@@ -243,7 +243,7 @@ void destroyQueryExecRes(SExecResult* pRes) {
break
;
break
;
}
}
case
TDMT_VND_SUBMIT
:
{
case
TDMT_VND_SUBMIT
:
{
t
FreeSSubmitRsp
((
SSubmitRsp
*
)
pRes
->
res
);
t
DestroySSubmitRsp2
((
SSubmitRsp2
*
)
pRes
->
res
,
TSDB_MSG_FLG_DECODE
);
break
;
break
;
}
}
case
TDMT_SCH_QUERY
:
case
TDMT_SCH_QUERY
:
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
2e75de83
...
@@ -259,46 +259,49 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
...
@@ -259,46 +259,49 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
if
(
msg
)
{
if
(
msg
)
{
SDecoder
coder
=
{
0
};
SDecoder
coder
=
{
0
};
SSubmitRsp
*
rsp
=
taosMemoryMalloc
(
sizeof
(
*
rsp
));
SSubmitRsp
2
*
rsp
=
taosMemoryMalloc
(
sizeof
(
*
rsp
));
tDecoderInit
(
&
coder
,
msg
,
msgSize
);
tDecoderInit
(
&
coder
,
msg
,
msgSize
);
code
=
tDecodeSSubmitRsp
(
&
coder
,
rsp
);
code
=
tDecodeSSubmitRsp
2
(
&
coder
,
rsp
);
if
(
code
)
{
if
(
code
)
{
SCH_TASK_ELOG
(
"
decode submitRsp
failed, code:%d"
,
code
);
SCH_TASK_ELOG
(
"
tDecodeSSubmitRsp2
failed, code:%d"
,
code
);
t
FreeSSubmitRsp
(
rsp
);
t
DestroySSubmitRsp2
(
rsp
,
TSDB_MSG_FLG_DECODE
);
SCH_ERR_JRET
(
code
);
SCH_ERR_JRET
(
code
);
}
}
if
(
rsp
->
nBlocks
>
0
)
{
for
(
int32_t
i
=
0
;
i
<
rsp
->
nBlocks
;
++
i
)
{
SSubmitBlkRsp
*
blk
=
rsp
->
pBlocks
+
i
;
if
(
TSDB_CODE_SUCCESS
!=
blk
->
code
)
{
code
=
blk
->
code
;
tFreeSSubmitRsp
(
rsp
);
SCH_ERR_JRET
(
code
);
}
}
}
atomic_add_fetch_32
(
&
pJob
->
resNumOfRows
,
rsp
->
affectedRows
);
atomic_add_fetch_32
(
&
pJob
->
resNumOfRows
,
rsp
->
affectedRows
);
SCH_TASK_DLOG
(
"submit succeed, affectedRows:%d, blocks:%d"
,
rsp
->
affectedRows
,
rsp
->
nBlocks
);
int32_t
createTbRspNum
=
taosArrayGetSize
(
rsp
->
aCreateTbRsp
);
SCH_LOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
SCH_TASK_DLOG
(
"submit succeed, affectedRows:%d, createTbRspNum:%d"
,
rsp
->
affectedRows
,
createTbRspNum
);
if
(
pJob
->
execRes
.
res
)
{
SSubmitRsp
*
sum
=
pJob
->
execRes
.
res
;
if
(
rsp
->
aCreateTbRsp
&&
taosArrayGetSize
(
rsp
->
aCreateTbRsp
)
>
0
)
{
sum
->
affectedRows
+=
rsp
->
affectedRows
;
SCH_LOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
sum
->
nBlocks
+=
rsp
->
nBlocks
;
if
(
pJob
->
execRes
.
res
)
{
if
(
rsp
->
nBlocks
>
0
&&
rsp
->
pBlocks
)
{
SSubmitRsp2
*
sum
=
pJob
->
execRes
.
res
;
sum
->
pBlocks
=
taosMemoryRealloc
(
sum
->
pBlocks
,
sum
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
sum
->
affectedRows
+=
rsp
->
affectedRows
;
memcpy
(
sum
->
pBlocks
+
sum
->
nBlocks
-
rsp
->
nBlocks
,
rsp
->
pBlocks
,
rsp
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
if
(
sum
->
aCreateTbRsp
)
{
taosArrayAddAll
(
sum
->
aCreateTbRsp
,
rsp
->
aCreateTbRsp
);
taosArrayDestroy
(
rsp
->
aCreateTbRsp
);
taosMemoryFree
(
rsp
);
}
else
{
TSWAP
(
sum
->
aCreateTbRsp
,
rsp
->
aCreateTbRsp
);
taosMemoryFree
(
rsp
);
}
}
else
{
pJob
->
execRes
.
res
=
rsp
;
pJob
->
execRes
.
msgType
=
TDMT_VND_SUBMIT
;
}
}
taosMemoryFree
(
rsp
->
pBlocks
)
;
pJob
->
execRes
.
numOfBytes
+=
pTask
->
msgLen
;
taosMemoryFree
(
rsp
);
SCH_UNLOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
}
else
{
}
else
{
pJob
->
execRes
.
res
=
rsp
;
SCH_LOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
pJob
->
execRes
.
msgType
=
TDMT_VND_SUBMIT
;
pJob
->
execRes
.
numOfBytes
+=
pTask
->
msgLen
;
if
(
NULL
==
pJob
->
execRes
.
res
)
{
TSWAP
(
pJob
->
execRes
.
res
,
rsp
);
pJob
->
execRes
.
msgType
=
TDMT_VND_SUBMIT
;
}
SCH_UNLOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
tDestroySSubmitRsp2
(
rsp
,
TSDB_MSG_FLG_DECODE
);
}
}
pJob
->
execRes
.
numOfBytes
+=
pTask
->
msgLen
;
SCH_UNLOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
}
}
taosMemoryFreeClear
(
msg
);
taosMemoryFreeClear
(
msg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录