From 57f15cfcdfa1e3f83808a6ec7d19b535355d9564 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 26 Oct 2020 17:15:35 +0800 Subject: [PATCH] compile error in windows --- src/client/src/tscFunctionImpl.c | 6 +++--- src/client/src/tscSubquery.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 7a668e85bf..74ddcbd3fd 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -4025,11 +4025,11 @@ static void ts_comp_function(SQLFunctionCtx *pCtx) { // primary ts must be existed, so no need to check its existance if (pCtx->order == TSDB_ORDER_ASC) { - tsBufAppend(pTSbuf, pCtx->param[0].i64Key, &pCtx->tag, input, pCtx->size * TSDB_KEYSIZE); + tsBufAppend(pTSbuf, (int32_t)pCtx->param[0].i64Key, &pCtx->tag, input, pCtx->size * TSDB_KEYSIZE); } else { for (int32_t i = pCtx->size - 1; i >= 0; --i) { char *d = GET_INPUT_CHAR_INDEX(pCtx, i); - tsBufAppend(pTSbuf, pCtx->param[0].i64Key, &pCtx->tag, d, TSDB_KEYSIZE); + tsBufAppend(pTSbuf, (int32_t)pCtx->param[0].i64Key, &pCtx->tag, d, (int32_t)TSDB_KEYSIZE); } } @@ -4048,7 +4048,7 @@ static void ts_comp_function_f(SQLFunctionCtx *pCtx, int32_t index) { STSBuf *pTSbuf = pInfo->pTSBuf; - tsBufAppend(pTSbuf, pCtx->param[0].i64Key, &pCtx->tag, pData, TSDB_KEYSIZE); + tsBufAppend(pTSbuf, (int32_t)pCtx->param[0].i64Key, &pCtx->tag, pData, TSDB_KEYSIZE); SET_VAL(pCtx, pCtx->size, 1); pResInfo->hasResult = DATA_SET_FLAG; diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index cece5e4f5c..b2390dfe30 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -924,7 +924,7 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR // for projection query, need to try next vnode if current vnode is exhausted int32_t numOfVgroups = 0; // TODO refactor if (pTableMetaInfo->pVgroupTables != NULL) { - numOfVgroups = taosArrayGetSize(pTableMetaInfo->pVgroupTables); + numOfVgroups = (int32_t)taosArrayGetSize(pTableMetaInfo->pVgroupTables); } else { numOfVgroups = pTableMetaInfo->vgroupList->numOfVgroups; } @@ -1054,7 +1054,7 @@ void tscFetchDatablockFromSubquery(SSqlObj* pSql) { // for projection query, need to try next vnode if current vnode is exhausted int32_t numOfVgroups = 0; // TODO refactor if (pTableMetaInfo->pVgroupTables != NULL) { - numOfVgroups = taosArrayGetSize(pTableMetaInfo->pVgroupTables); + numOfVgroups = (int32_t)taosArrayGetSize(pTableMetaInfo->pVgroupTables); } else { numOfVgroups = pTableMetaInfo->vgroupList->numOfVgroups; } @@ -1510,7 +1510,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) { if (pTableMetaInfo->pVgroupTables == NULL) { pState->numOfSub = pTableMetaInfo->vgroupList->numOfVgroups; } else { - pState->numOfSub = taosArrayGetSize(pTableMetaInfo->pVgroupTables); + pState->numOfSub = (int32_t)taosArrayGetSize(pTableMetaInfo->pVgroupTables); } assert(pState->numOfSub > 0); @@ -2160,7 +2160,7 @@ static void doBuildResFromSubqueries(SSqlObj* pSql) { continue; } - int32_t remain = pSub->res.numOfRows - pSub->res.row; + int32_t remain = (int32_t)(pSub->res.numOfRows - pSub->res.row); numOfRes = (int32_t)(MIN(numOfRes, remain)); } @@ -2222,7 +2222,7 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) { SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo); - pRes->numOfCols = numOfExprs; + pRes->numOfCols = (int32_t)numOfExprs; pRes->tsrow = calloc(numOfExprs, POINTER_BYTES); pRes->buffer = calloc(numOfExprs, POINTER_BYTES); -- GitLab