提交 6e43fe52 编写于 作者: H Haojun Liao

[td-621]

上级 3326df48
......@@ -1912,6 +1912,10 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
assert(size > 0);
pSql->pSubs = calloc(size, POINTER_BYTES);
if (pSql->pSubs == NULL) {
goto _error;
}
pSql->numOfSubs = (uint16_t)size;
tscDebug("%p submit data to %" PRIzu " vnode(s)", pSql, size);
......@@ -1925,6 +1929,10 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
while(numOfSub < pSql->numOfSubs) {
SInsertSupporter* pSupporter = calloc(1, sizeof(SInsertSupporter));
if (pSupporter == NULL) {
goto _error;
}
pSupporter->pSql = pSql;
pSupporter->pState = pState;
pSupporter->index = numOfSub;
......@@ -1957,7 +1965,7 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
if (numOfSub < pSql->numOfSubs) {
tscError("%p failed to prepare subObj structure and launch sub-insertion", pSql);
pRes->code = TSDB_CODE_TSC_OUT_OF_MEMORY;
return pRes->code; // free all allocated resource
goto _error;
}
pCmd->pDataBlocks = tscDestroyBlockArrayList(pCmd->pDataBlocks);
......
......@@ -1526,8 +1526,11 @@ int32_t tscAddSubqueryInfo(SSqlCmd* pCmd) {
pCmd->pQueryInfo = (SQueryInfo**)tmp;
SQueryInfo* pQueryInfo = calloc(1, sizeof(SQueryInfo));
if (pQueryInfo == NULL) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
tscInitQueryInfo(pQueryInfo);
pQueryInfo->msg = pCmd->payload; // pointer to the parent error message buffer
pCmd->pQueryInfo[pCmd->numOfClause++] = pQueryInfo;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册