diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index f4e0788f5634a5d0dcd8b101901005f5fbf31ddd..9a85fbf8f65193d6239c6b58bf0c6577d77a6250 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -283,8 +283,15 @@ void tscAsyncFetchSingleRowProxy(void *param, TAOS_RES *tres, int numOfRows) { return; } - for (int i = 0; i < pCmd->numOfCols; ++i) - pRes->tsrow[i] = TSC_GET_RESPTR_BASE(pRes, pQueryInfo, i) + pRes->bytes[i] * pRes->row; + for (int i = 0; i < pCmd->numOfCols; ++i){ + SSqlExpr* pExpr = pQueryInfo->fieldsInfo.pSqlExpr[i]; + if (pExpr != NULL) { + pRes->tsrow[i] = TSC_GET_RESPTR_BASE(pRes, pQueryInfo, i) + pExpr->resBytes * pRes->row; + } else { + //todo add + } + } + pRes->row++; (*pSql->fetchFp)(pSql->param, pSql, pSql->res.tsrow); @@ -298,7 +305,12 @@ void tscProcessFetchRow(SSchedMsg *pMsg) { SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(pCmd, pCmd->clauseIndex); for (int i = 0; i < pCmd->numOfCols; ++i) { - pRes->tsrow[i] = TSC_GET_RESPTR_BASE(pRes, pQueryInfo, i) + pRes->bytes[i] * pRes->row; + SSqlExpr* pExpr = pQueryInfo->fieldsInfo.pSqlExpr[i]; + if (pExpr != NULL) { + pRes->tsrow[i] = TSC_GET_RESPTR_BASE(pRes, pQueryInfo, i) + pExpr->resBytes * pRes->row; + } else { + //todo add + } } pRes->row++; diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index ca6c5ad2368ceb36b2f1e587ee022a08607377e8..9599d280eab2e4d9e30b6f67bfb0f05c5783c515 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -231,7 +231,7 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { SSqlCmd * pCmd = &pSql->cmd; SMeterMetaInfo *pMeterMetaInfo = tscGetMeterMetaInfo(pCmd, pCmd->clauseIndex, 0); - + if (UTIL_METER_IS_SUPERTABLE(pMeterMetaInfo)) { // multiple vnode query SVnodeSidList *vnodeList = tscGetVnodeSidList(pMeterMetaInfo->pMetricMeta, pMeterMetaInfo->vnodeIndex); if (vnodeList != NULL) { @@ -254,6 +254,8 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { while (pSql->retry < pSql->maxRetry) { (pSql->retry)++; + pSql->index = pSql->index%TSDB_VNODES_SUPPORT; + char ipstr[40] = {0}; if (pVPeersDesc[pSql->index].ip == 0) { /* diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 6dcf27b1d7c00da77fcfa4f8e78cb2d9caae4c3c..fd6210ee561dd2f1ed0a3d269da998c330ec3b0e 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -203,6 +203,9 @@ SMeterSidExtInfo* tscGetMeterSidInfo(SVnodeSidList* pSidList, int32_t idx) { tscError("illegal sidIdx:%d, reset to 0, sidIdx range:%d-%d", idx, 0, sidRange); idx = 0; } + + assert(pSidList->pSidExtInfoList[idx] >= 0); + return (SMeterSidExtInfo*)(pSidList->pSidExtInfoList[idx] + (char*)pSidList); } diff --git a/src/system/detail/src/vnodeQueryProcess.c b/src/system/detail/src/vnodeQueryProcess.c index c52a27713e72efebeb75856ed80a0f5a3e309391..213e837f0c70992976f1ffaa49b699071babc86f 100644 --- a/src/system/detail/src/vnodeQueryProcess.c +++ b/src/system/detail/src/vnodeQueryProcess.c @@ -947,12 +947,6 @@ static void vnodeMultiMeterQueryProcessor(SQInfo *pQInfo) { dTrace("QInfo:%p main scan completed, elapsed time: %lldms, supplementary scan start, order:%d", pQInfo, et - st, pQuery->order.order ^ 1); - // failed to save all intermediate results into disk, abort further query processing - // if (doCloseAllOpenedResults(pSupporter) != TSDB_CODE_SUCCESS) { - // dError("QInfo:%p failed to save intermediate results, abort further query processing", pQInfo); - // return; - // } - if (pQuery->intervalTime > 0) { for (int32_t i = 0; i < pSupporter->numOfMeters; ++i) { SMeterQueryInfo *pMeterQueryInfo = pSupporter->pMeterDataInfo[i].pMeterQInfo;