diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index e5bb516ee683a8acf44bb4c7a01b0fdc6475a57f..c74a403a041dac4fe205c06746d23dce64cd342e 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1158,8 +1158,9 @@ static int32_t handleArithmeticExpr(SSqlCmd* pCmd, int32_t clauseIndex, int32_t int32_t ret = exprTreeFromSqlExpr(pCmd, &pNode, pItem->pNode, pQueryInfo->exprList, pQueryInfo, colList); if (ret != TSDB_CODE_SUCCESS) { - tExprTreeDestroy(&pNode, NULL); taosTFree(arithmeticExprStr); + taosArrayDestroy(colList); + tExprTreeDestroy(&pNode, NULL); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } @@ -1168,6 +1169,8 @@ static int32_t handleArithmeticExpr(SSqlCmd* pCmd, int32_t clauseIndex, int32_t SColIndex* pIndex = taosArrayGet(colList, k); if (pIndex->flag == 1) { taosTFree(arithmeticExprStr); + taosArrayDestroy(colList); + tExprTreeDestroy(&pNode, NULL); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3); } } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 6b75b680b10858ecb6789aba6a0f92aa61c3a38a..4c73c6d9682036c0227be1b42e45d8f9f80b946b 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -158,6 +158,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) { if (pRsp->killConnection) { tscKillConnection(pObj); + return; } else { if (pRsp->queryId) tscKillQuery(pObj, htonl(pRsp->queryId)); if (pRsp->streamId) tscKillStream(pObj, htonl(pRsp->streamId)); diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 75644c355cd15385b96b072c2b90ecc58d395d73..d2b5439f8d082d93bb628b8532c34b51b378272b 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -684,6 +684,8 @@ static void tidTagRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow freeJoinSubqueryObj(pParentSql); pParentSql->res.code = code; tscQueueAsyncRes(pParentSql); + taosArrayDestroy(s1); + taosArrayDestroy(s2); return; } @@ -1296,7 +1298,9 @@ int32_t tscHandleMasterJoinQuery(SSqlObj* pSql) { tscError("%p tableIndex:%d, failed to allocate join support object, abort further query", pSql, i); pState->numOfRemain = i; pSql->res.code = TSDB_CODE_TSC_OUT_OF_MEMORY; - + if (0 == i) { + taosTFree(pState); + } return pSql->res.code; } @@ -1304,7 +1308,9 @@ int32_t tscHandleMasterJoinQuery(SSqlObj* pSql) { if (code != TSDB_CODE_SUCCESS) { // failed to create subquery object, quit query tscDestroyJoinSupporter(pSupporter); pSql->res.code = TSDB_CODE_TSC_OUT_OF_MEMORY; - + if (0 == i) { + taosTFree(pState); + } break; } } @@ -2091,17 +2097,17 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) { // return; // } - tscFetchDatablockFromSubquery(pSql); - if (pRes->code != TSDB_CODE_SUCCESS) { - return; - } +// tscFetchDatablockFromSubquery(pSql); +// if (pRes->code != TSDB_CODE_SUCCESS) { +// return; +// } } - if (pSql->res.code == TSDB_CODE_SUCCESS) { - (*pSql->fp)(pSql->param, pSql, pRes->numOfRows); - } else { - tscQueueAsyncRes(pSql); - } +// if (pSql->res.code == TSDB_CODE_SUCCESS) { +// (*pSql->fp)(pSql->param, pSql, pRes->numOfRows); +// } else { +// tscQueueAsyncRes(pSql); +// } } static void transferNcharData(SSqlObj *pSql, int32_t columnIndex, TAOS_FIELD *pField) {