[td-225]
This commit is contained in:
parent
5bcfde01e3
commit
fed4f0f28b
|
@ -42,11 +42,13 @@ static void tscAsyncFetchSingleRowProxy(void *param, TAOS_RES *tres, int numOfRo
|
||||||
int doAsyncParseSql(SSqlObj* pSql) {
|
int doAsyncParseSql(SSqlObj* pSql) {
|
||||||
SSqlCmd* pCmd = &pSql->cmd;
|
SSqlCmd* pCmd = &pSql->cmd;
|
||||||
SSqlRes* pRes = &pSql->res;
|
SSqlRes* pRes = &pSql->res;
|
||||||
|
|
||||||
int32_t code = tscAllocPayload(pCmd, TSDB_DEFAULT_PAYLOAD_SIZE);
|
int32_t code = tscAllocPayload(pCmd, TSDB_DEFAULT_PAYLOAD_SIZE);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
tscError("failed to malloc payload");
|
tscError("failed to malloc payload");
|
||||||
|
pSql->res.code = code;
|
||||||
|
|
||||||
tscQueueAsyncRes(pSql);
|
tscQueueAsyncRes(pSql);
|
||||||
// tscQueueAsyncRes(pSql->fp, pSql->param, TSDB_CODE_TSC_OUT_OF_MEMORY);
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,8 +198,6 @@ int tscSendMsgToServer(SSqlObj *pSql) {
|
||||||
};
|
};
|
||||||
|
|
||||||
pSql->SRpcReqContext = rpcSendRequest(pObj->pDnodeConn, &pSql->ipList, &rpcMsg);
|
pSql->SRpcReqContext = rpcSendRequest(pObj->pDnodeConn, &pSql->ipList, &rpcMsg);
|
||||||
assert(pSql->SRpcReqContext != NULL);
|
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1896,6 +1896,7 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
|
||||||
tscTrace("%p submit data to %d vnode(s)", pSql, pDataBlocks->nSize);
|
tscTrace("%p submit data to %d vnode(s)", pSql, pDataBlocks->nSize);
|
||||||
SSubqueryState *pState = calloc(1, sizeof(SSubqueryState));
|
SSubqueryState *pState = calloc(1, sizeof(SSubqueryState));
|
||||||
pState->numOfTotal = pSql->numOfSubs;
|
pState->numOfTotal = pSql->numOfSubs;
|
||||||
|
pState->numOfRemain = pState->numOfTotal;
|
||||||
|
|
||||||
pRes->code = TSDB_CODE_SUCCESS;
|
pRes->code = TSDB_CODE_SUCCESS;
|
||||||
|
|
||||||
|
@ -1917,7 +1918,6 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
|
||||||
*/
|
*/
|
||||||
pNew->fetchFp = pNew->fp;
|
pNew->fetchFp = pNew->fp;
|
||||||
pSql->pSubs[i] = pNew;
|
pSql->pSubs[i] = pNew;
|
||||||
pNew->fetchFp = pNew->fp;
|
|
||||||
|
|
||||||
tscTrace("%p sub:%p create subObj success. orderOfSub:%d", pSql, pNew, i);
|
tscTrace("%p sub:%p create subObj success. orderOfSub:%d", pSql, pNew, i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1581,24 +1581,6 @@ void tscClearSubqueryInfo(SSqlCmd* pCmd) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void doRemoveTableMetaInfo(SQueryInfo* pQueryInfo, int32_t index, bool removeFromCache) {
|
|
||||||
if (index < 0 || index >= pQueryInfo->numOfTables) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index);
|
|
||||||
|
|
||||||
tscClearTableMetaInfo(pTableMetaInfo, removeFromCache);
|
|
||||||
free(pTableMetaInfo);
|
|
||||||
|
|
||||||
int32_t after = pQueryInfo->numOfTables - index - 1;
|
|
||||||
if (after > 0) {
|
|
||||||
memmove(&pQueryInfo->pTableMetaInfo[index], &pQueryInfo->pTableMetaInfo[index + 1], after * POINTER_BYTES);
|
|
||||||
}
|
|
||||||
|
|
||||||
pQueryInfo->numOfTables -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void clearAllTableMetaInfo(SQueryInfo* pQueryInfo, const char* address, bool removeFromCache) {
|
void clearAllTableMetaInfo(SQueryInfo* pQueryInfo, const char* address, bool removeFromCache) {
|
||||||
tscTrace("%p deref the table meta in cache, numOfTables:%d", address, pQueryInfo->numOfTables);
|
tscTrace("%p deref the table meta in cache, numOfTables:%d", address, pQueryInfo->numOfTables);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue