From 4674475509c97e6199c47596b6180d7f5f18da30 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 19 Jun 2020 11:32:42 +0800 Subject: [PATCH] [td-225] update the error code info --- src/client/src/tscLocalMerge.c | 10 +++++----- src/client/src/tscSubquery.c | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/client/src/tscLocalMerge.c b/src/client/src/tscLocalMerge.c index f64287bdc4..19395d6af8 100644 --- a/src/client/src/tscLocalMerge.c +++ b/src/client/src/tscLocalMerge.c @@ -413,13 +413,13 @@ static int32_t tscFlushTmpBufferImpl(tExtMemBuffer *pMemoryBuf, tOrderDescriptor } int32_t tscFlushTmpBuffer(tExtMemBuffer *pMemoryBuf, tOrderDescriptor *pDesc, tFilePage *pPage, int32_t orderType) { - int32_t ret = tscFlushTmpBufferImpl(pMemoryBuf, pDesc, pPage, orderType); - if (ret != 0) { - return -1; + int32_t ret = 0; + if ((ret = tscFlushTmpBufferImpl(pMemoryBuf, pDesc, pPage, orderType)) != 0) { + return ret; } - if (!tExtMemBufferFlush(pMemoryBuf)) { - return -1; + if ((ret = tExtMemBufferFlush(pMemoryBuf)) != 0) { + return ret; } return 0; diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 42a5d1d09b..425010649c 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1492,7 +1492,7 @@ static void tscAbortFurtherRetryRetrieval(SRetrieveSupport *trsupport, TAOS_RES tscError("sub:%p failed to flush data to disk:reason:%s", tres, lpMsgBuf); LocalFree(lpMsgBuf); #else - tscError("sub:%p failed to flush data to disk:reason:%s", tres, strerror(errno)); + tscError("sub:%p failed to flush data to disk, reason:%s", tres, tstrerror(code)); #endif SSqlObj* pParentSql = trsupport->pParentSqlObj; @@ -1630,10 +1630,9 @@ static void tscAllDataRetrievedFromDnode(SRetrieveSupport *trsupport, SSqlObj* p // each result for a vnode is ordered as an independant list, // then used as an input of loser tree for disk-based merge routine - int32_t ret = tscFlushTmpBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, - pQueryInfo->groupbyExpr.orderType); + int32_t ret = tscFlushTmpBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, pQueryInfo->groupbyExpr.orderType); if (ret != 0) { // set no disk space error info, and abort retry - return tscAbortFurtherRetryRetrieval(trsupport, pSql, TSDB_CODE_TSC_NO_DISKSPACE); + return tscAbortFurtherRetryRetrieval(trsupport, pSql, ret); } int32_t remain = -1; @@ -1704,7 +1703,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR tscTrace("%p sub:%p retrieve numOfRows:%" PRId64 " totalNumOfRows:%" PRIu64 " from ip:%s, orderOfSub:%d", pPObj, pSql, pRes->numOfRows, pState->numOfRetrievedRows, pSql->ipList.fqdn[pSql->ipList.inUse], idx); - + if (num > tsMaxNumOfOrderedResults && tscIsProjectionQueryOnSTable(pQueryInfo, 0)) { tscError("%p sub:%p num of OrderedRes is too many, max allowed:%" PRId32 " , current:%" PRId64, pPObj, pSql, tsMaxNumOfOrderedResults, num); @@ -1729,7 +1728,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR int32_t ret = saveToBuffer(trsupport->pExtMemBuffer[idx], pDesc, trsupport->localBuffer, pRes->data, pRes->numOfRows, pQueryInfo->groupbyExpr.orderType); - if (ret < 0) { // set no disk space error info, and abort retry + if (ret != 0) { // set no disk space error info, and abort retry tscAbortFurtherRetryRetrieval(trsupport, tres, TSDB_CODE_TSC_NO_DISKSPACE); pthread_mutex_unlock(&trsupport->queryMutex); -- GitLab