From ebed0de405933e3fee7580442d6d026603763be9 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 17 Jul 2020 02:11:36 +0800 Subject: [PATCH] [td-225] fix error in top/bottom query --- src/client/src/tscFunctionImpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 8e81462257..262b7ab3f6 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -2292,8 +2292,9 @@ static void top_func_second_merge(SQLFunctionCtx *pCtx) { // the intermediate result is binary, we only use the output data type for (int32_t i = 0; i < pInput->num; ++i) { + int16_t type = (pCtx->outputType == TSDB_DATA_TYPE_FLOAT)? TSDB_DATA_TYPE_DOUBLE:pCtx->outputType; do_top_function_add(pOutput, pCtx->param[0].i64Key, &pInput->res[i]->v.i64Key, pInput->res[i]->timestamp, - pCtx->outputType, &pCtx->tagInfo, pInput->res[i]->pTags, pCtx->currentStage); + type, &pCtx->tagInfo, pInput->res[i]->pTags, pCtx->currentStage); } SET_VAL(pCtx, pInput->num, pOutput->num); -- GitLab