提交 1c6991d4 编写于 作者: D dapan1121

fix windows compile error

上级 d9853b48
...@@ -1757,7 +1757,7 @@ void genUdfList(SArray* pUdfInfo, tSqlExpr *pNode) { ...@@ -1757,7 +1757,7 @@ void genUdfList(SArray* pUdfInfo, tSqlExpr *pNode) {
if (pNode->functionId < 0) { // extract all possible user defined function if (pNode->functionId < 0) { // extract all possible user defined function
struct SUdfInfo info = {0}; struct SUdfInfo info = {0};
info.name = strndup(pNode->operand.z, pNode->operand.n); info.name = strndup(pNode->operand.z, pNode->operand.n);
int32_t functionId = taosArrayGetSize(pUdfInfo) * (-1) - 1; int32_t functionId = (int32_t)taosArrayGetSize(pUdfInfo) * (-1) - 1;
info.functionId = functionId; info.functionId = functionId;
taosArrayPush(pUdfInfo, &info); taosArrayPush(pUdfInfo, &info);
...@@ -3212,7 +3212,7 @@ static bool functionCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, bool ...@@ -3212,7 +3212,7 @@ static bool functionCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, bool
} }
} }
aggNum = size - prjNum - aggUdf - scalarUdf; aggNum = (int32_t)size - prjNum - aggUdf - scalarUdf;
assert(aggNum >= 0); assert(aggNum >= 0);
......
...@@ -1867,7 +1867,7 @@ int tscBuildRetrieveFuncMsg(SSqlObj *pSql, SSqlInfo *pInfo) { ...@@ -1867,7 +1867,7 @@ int tscBuildRetrieveFuncMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SSqlCmd *pCmd = &pSql->cmd; SSqlCmd *pCmd = &pSql->cmd;
char *pMsg = pCmd->payload; char *pMsg = pCmd->payload;
int32_t numOfFuncs = taosArrayGetSize(pCmd->pUdfInfo); int32_t numOfFuncs = (int32_t)taosArrayGetSize(pCmd->pUdfInfo);
SRetrieveFuncMsg *pRetrieveFuncMsg = (SRetrieveFuncMsg *)pMsg; SRetrieveFuncMsg *pRetrieveFuncMsg = (SRetrieveFuncMsg *)pMsg;
pRetrieveFuncMsg->num = htonl(numOfFuncs); pRetrieveFuncMsg->num = htonl(numOfFuncs);
......
...@@ -459,10 +459,10 @@ static int32_t mnodeProcessRetrieveFuncImplMsg(SMnodeMsg *pMsg) { ...@@ -459,10 +459,10 @@ static int32_t mnodeProcessRetrieveFuncImplMsg(SMnodeMsg *pMsg) {
pFuncInfo->resBytes = htons(pFuncObj->resBytes); pFuncInfo->resBytes = htons(pFuncObj->resBytes);
pOutput += sizeof(SFunctionInfoMsg) + pFuncObj->contLen; pOutput += sizeof(SFunctionInfoMsg) + pFuncObj->contLen;
name =(void *)name + sizeof(*name) + htons(name->len); name =(tstr *)((char *)name + sizeof(*name) + htons(name->len));
} }
pMsg->rpcRsp.rsp = pFuncMsg; pMsg->rpcRsp.rsp = pFuncMsg;
pMsg->rpcRsp.len = (pOutput - (char*)pFuncMsg); pMsg->rpcRsp.len = (int32_t)(pOutput - (char*)pFuncMsg);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -45,7 +45,7 @@ typedef struct SUdfInfo { ...@@ -45,7 +45,7 @@ typedef struct SUdfInfo {
}; };
} SUdfInfo; } SUdfInfo;
typedef void (*udfNormalFunc)(char* data, int8_t type, int32_t numOfRows, int64_t* ts, char* dataOutput, char* tsOutput, typedef void (*udfNormalFunc)(char* data, int16_t type, int32_t numOfRows, int64_t* ts, char* dataOutput, char* tsOutput,
int32_t* numOfOutput, SUdfInit* buf); int32_t* numOfOutput, SUdfInit* buf);
typedef int32_t (*udfInitFunc)(SUdfInit* data); typedef int32_t (*udfInitFunc)(SUdfInit* data);
typedef void (*udfFinalizeFunc)(char* dataOutput, int32_t* numOfOutput, SUdfInit* buf); typedef void (*udfFinalizeFunc)(char* dataOutput, int32_t* numOfOutput, SUdfInit* buf);
......
...@@ -779,8 +779,8 @@ static void doInvokeUdf(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx *pCtx, int ...@@ -779,8 +779,8 @@ static void doInvokeUdf(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx *pCtx, int
if (pUdfInfo && pUdfInfo->funcs[TSDB_UDF_FUNC_NORMAL]) { if (pUdfInfo && pUdfInfo->funcs[TSDB_UDF_FUNC_NORMAL]) {
qDebug("invoke udf function:%s,%p", pUdfInfo->name, pUdfInfo->funcs[TSDB_UDF_FUNC_NORMAL]); qDebug("invoke udf function:%s,%p", pUdfInfo->name, pUdfInfo->funcs[TSDB_UDF_FUNC_NORMAL]);
(*(udfNormalFunc)pUdfInfo->funcs[TSDB_UDF_FUNC_NORMAL])(pCtx->pInput + idx * pCtx->inputType, pCtx->inputType, pCtx->size, pCtx->ptsList, pCtx->pOutput, (*(udfNormalFunc)pUdfInfo->funcs[TSDB_UDF_FUNC_NORMAL])((char *)pCtx->pInput + idx * pCtx->inputType, pCtx->inputType, pCtx->size, pCtx->ptsList, pCtx->pOutput,
pCtx->ptsOutputBuf, &output, &pUdfInfo->init); (char *)pCtx->ptsOutputBuf, &output, &pUdfInfo->init);
// set the output value exist // set the output value exist
pCtx->resultInfo->numOfRes += output; pCtx->resultInfo->numOfRes += output;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册