提交 555125af 编写于 作者: P plum-lihui

fix windows 32bit compile error

上级 107eb310
...@@ -1633,7 +1633,7 @@ void tscInitResObjForLocalQuery(SSqlObj *pObj, int32_t numOfRes, int32_t rowLen) ...@@ -1633,7 +1633,7 @@ void tscInitResObjForLocalQuery(SSqlObj *pObj, int32_t numOfRes, int32_t rowLen)
int32_t doArithmeticCalculate(SQueryInfo* pQueryInfo, tFilePage* pOutput, int32_t rowSize, int32_t finalRowSize) { int32_t doArithmeticCalculate(SQueryInfo* pQueryInfo, tFilePage* pOutput, int32_t rowSize, int32_t finalRowSize) {
int32_t maxRowSize = MAX(rowSize, finalRowSize); int32_t maxRowSize = MAX(rowSize, finalRowSize);
char* pbuf = calloc(1, pOutput->num * maxRowSize); char* pbuf = calloc(1, (size_t)(pOutput->num * maxRowSize));
size_t size = tscNumOfFields(pQueryInfo); size_t size = tscNumOfFields(pQueryInfo);
SArithmeticSupport arithSup = {0}; SArithmeticSupport arithSup = {0};
...@@ -1660,16 +1660,16 @@ int32_t doArithmeticCalculate(SQueryInfo* pQueryInfo, tFilePage* pOutput, int32_ ...@@ -1660,16 +1660,16 @@ int32_t doArithmeticCalculate(SQueryInfo* pQueryInfo, tFilePage* pOutput, int32_
tExprTreeCalcTraverse(arithSup.pArithExpr->pExpr, (int32_t) pOutput->num, pbuf + pOutput->num*offset, &arithSup, TSDB_ORDER_ASC, getArithmeticInputSrc); tExprTreeCalcTraverse(arithSup.pArithExpr->pExpr, (int32_t) pOutput->num, pbuf + pOutput->num*offset, &arithSup, TSDB_ORDER_ASC, getArithmeticInputSrc);
} else { } else {
SSqlExpr* pExpr = pSup->pSqlExpr; SSqlExpr* pExpr = pSup->pSqlExpr;
memcpy(pbuf + pOutput->num * offset, pExpr->offset * pOutput->num + pOutput->data, pExpr->resBytes * pOutput->num); memcpy(pbuf + pOutput->num * offset, pExpr->offset * pOutput->num + pOutput->data, (size_t)(pExpr->resBytes * pOutput->num));
} }
offset += pSup->field.bytes; offset += pSup->field.bytes;
} }
memcpy(pOutput->data, pbuf, pOutput->num * offset); memcpy(pOutput->data, pbuf, (size_t)(pOutput->num * offset));
tfree(pbuf); tfree(pbuf);
tfree(arithSup.data); tfree(arithSup.data);
return offset; return offset;
} }
\ No newline at end of file
...@@ -5837,7 +5837,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) { ...@@ -5837,7 +5837,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) {
tFilePage **data = calloc(pQuery->numOfExpr2, POINTER_BYTES); tFilePage **data = calloc(pQuery->numOfExpr2, POINTER_BYTES);
for (int32_t i = 0; i < pQuery->numOfExpr2; ++i) { for (int32_t i = 0; i < pQuery->numOfExpr2; ++i) {
int32_t bytes = pQuery->pExpr2[i].bytes; int32_t bytes = pQuery->pExpr2[i].bytes;
data[i] = (tFilePage *)malloc(bytes * pQuery->rec.rows + sizeof(tFilePage)); data[i] = (tFilePage *)malloc((size_t)(bytes * pQuery->rec.rows) + sizeof(tFilePage));
} }
arithSup.offset = 0; arithSup.offset = 0;
...@@ -5859,7 +5859,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) { ...@@ -5859,7 +5859,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) {
for (int32_t j = 0; j < pQuery->numOfOutput; ++j) { for (int32_t j = 0; j < pQuery->numOfOutput; ++j) {
if (pSqlFunc->functionId == pQuery->pExpr1[j].base.functionId && if (pSqlFunc->functionId == pQuery->pExpr1[j].base.functionId &&
pSqlFunc->colInfo.colId == pQuery->pExpr1[j].base.colInfo.colId) { pSqlFunc->colInfo.colId == pQuery->pExpr1[j].base.colInfo.colId) {
memcpy(data[i]->data, pQuery->sdata[j]->data, pQuery->pExpr1[j].bytes * pQuery->rec.rows); memcpy(data[i]->data, pQuery->sdata[j]->data, (size_t)(pQuery->pExpr1[j].bytes * pQuery->rec.rows));
break; break;
} }
} }
...@@ -5871,7 +5871,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) { ...@@ -5871,7 +5871,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) {
} }
for (int32_t i = 0; i < pQuery->numOfExpr2; ++i) { for (int32_t i = 0; i < pQuery->numOfExpr2; ++i) {
memcpy(pQuery->sdata[i]->data, data[i]->data, pQuery->pExpr2[i].bytes * pQuery->rec.rows); memcpy(pQuery->sdata[i]->data, data[i]->data, (size_t)(pQuery->pExpr2[i].bytes * pQuery->rec.rows));
} }
for (int32_t i = 0; i < pQuery->numOfExpr2; ++i) { for (int32_t i = 0; i < pQuery->numOfExpr2; ++i) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册