[td-255] fix compiler error on windows.

This commit is contained in:
Haojun Liao 2021-06-03 18:12:56 +08:00
parent 9216a9f201
commit 7082d8a5e0
1 changed files with 3 additions and 3 deletions

View File

@ -4478,7 +4478,7 @@ static void ts_comp_finalize(SQLFunctionCtx *pCtx) {
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
// rate functions // rate functions
static double do_calc_rate(const SRateInfo* pRateInfo, int64_t tickPerSec) { static double do_calc_rate(const SRateInfo* pRateInfo, double tickPerSec) {
if ((INT64_MIN == pRateInfo->lastKey) || (INT64_MIN == pRateInfo->firstKey) || if ((INT64_MIN == pRateInfo->lastKey) || (INT64_MIN == pRateInfo->firstKey) ||
(pRateInfo->firstKey >= pRateInfo->lastKey)) { (pRateInfo->firstKey >= pRateInfo->lastKey)) {
return 0.0; return 0.0;
@ -4504,7 +4504,7 @@ static double do_calc_rate(const SRateInfo* pRateInfo, int64_t tickPerSec) {
return 0; return 0;
} }
return (duration > 0)? ((double)diff) / (duration/((double) tickPerSec)):0.0; return (duration > 0)? ((double)diff) / (duration/tickPerSec):0.0;
} }
static bool rate_function_setup(SQLFunctionCtx *pCtx) { static bool rate_function_setup(SQLFunctionCtx *pCtx) {
@ -4636,7 +4636,7 @@ static void rate_finalizer(SQLFunctionCtx *pCtx) {
return; return;
} }
*(double*) pCtx->pOutput = (double) do_calc_rate(pRateInfo, TSDB_TICK_PER_SECOND(pCtx->param[0].i64)); *(double*) pCtx->pOutput = do_calc_rate(pRateInfo, TSDB_TICK_PER_SECOND(pCtx->param[0].i64));
// cannot set the numOfIteratedElems again since it is set during previous iteration // cannot set the numOfIteratedElems again since it is set during previous iteration
pResInfo->numOfRes = 1; pResInfo->numOfRes = 1;