From fed4f0f28bfdfc4ba2408a040e70e7d717bd4734 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 19 Jun 2020 18:51:13 +0800 Subject: [PATCH] [td-225] --- src/client/src/tscAsync.c | 4 +++- src/client/src/tscParseInsert.c | 2 +- src/client/src/tscServer.c | 2 -- src/client/src/tscSubquery.c | 6 +++--- src/client/src/tscUtil.c | 18 ------------------ 5 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 3fedc9e7ad..3c54176d0a 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -42,11 +42,13 @@ static void tscAsyncFetchSingleRowProxy(void *param, TAOS_RES *tres, int numOfRo int doAsyncParseSql(SSqlObj* pSql) { SSqlCmd* pCmd = &pSql->cmd; SSqlRes* pRes = &pSql->res; + int32_t code = tscAllocPayload(pCmd, TSDB_DEFAULT_PAYLOAD_SIZE); if (code != TSDB_CODE_SUCCESS) { tscError("failed to malloc payload"); + pSql->res.code = code; + tscQueueAsyncRes(pSql); -// tscQueueAsyncRes(pSql->fp, pSql->param, TSDB_CODE_TSC_OUT_OF_MEMORY); return code; } diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index d821271857..4b6178eb61 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -1354,7 +1354,7 @@ int tsParseSql(SSqlObj *pSql, bool initialParse) { if (TSDB_CODE_SUCCESS != ret) { return ret; } - + SSqlInfo SQLInfo = qSQLParse(pSql->sqlstr); ret = tscToSQLCmd(pSql, &SQLInfo); SQLInfoDestroy(&SQLInfo); diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 1384dcecff..6e3602b69d 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -198,8 +198,6 @@ int tscSendMsgToServer(SSqlObj *pSql) { }; pSql->SRpcReqContext = rpcSendRequest(pObj->pDnodeConn, &pSql->ipList, &rpcMsg); - assert(pSql->SRpcReqContext != NULL); - return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index a3e655a971..aaa5ab291f 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1896,7 +1896,8 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { tscTrace("%p submit data to %d vnode(s)", pSql, pDataBlocks->nSize); SSubqueryState *pState = calloc(1, sizeof(SSubqueryState)); pState->numOfTotal = pSql->numOfSubs; - + pState->numOfRemain = pState->numOfTotal; + pRes->code = TSDB_CODE_SUCCESS; int32_t i = 0; @@ -1917,8 +1918,7 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { */ pNew->fetchFp = pNew->fp; pSql->pSubs[i] = pNew; - pNew->fetchFp = pNew->fp; - + tscTrace("%p sub:%p create subObj success. orderOfSub:%d", pSql, pNew, i); } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index cbf1aa12be..110a435e57 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -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) { tscTrace("%p deref the table meta in cache, numOfTables:%d", address, pQueryInfo->numOfTables); -- GitLab