提交 1a22877d 编写于 作者: wmmhello's avatar wmmhello

fix error in mode function

上级 26343da7
......@@ -5411,8 +5411,8 @@ int32_t functionCompatList[] = {
1, 1, 1, 1, -1, 1, 1, 1, 5, 1, 1,
// tid_tag, deriv, csum, mavg, sample,
6, 8, -1, -1, -1,
// block_info,elapsed,histogram,unique
7, 1, -1, -1
// block_info,elapsed,histogram,unique,mode
7, 1, -1, -1, 1
};
SAggFunctionInfo aAggs[TSDB_FUNC_MAX_NUM] = {{
......
......@@ -3687,7 +3687,7 @@ void setDefaultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, SOptrBasicInfo *pInfo, i
if (pCtx[i].functionId == TSDB_FUNC_UNIQUE) {
pCtx[i].pUniqueSet = &pRow->uniqueHash;
}else if (pCtx[i].functionId == TSDB_FUNC_MODE) {
pCtx[i].pUniqueSet = &pRow->modeHash;
pCtx[i].pModeSet = &pRow->modeHash;
}
pCtx[i].pOutput = pData->pData;
pCtx[i].currentStage = stage;
......@@ -4026,7 +4026,7 @@ void setResultRowOutputBufInitCtx(SQueryRuntimeEnv *pRuntimeEnv, SResultRow *pRe
if (pCtx[i].functionId == TSDB_FUNC_UNIQUE){
pCtx[i].pUniqueSet = &pResult->uniqueHash;
}else if (pCtx[i].functionId == TSDB_FUNC_MODE){
pCtx[i].pUniqueSet = &pResult->modeHash;
pCtx[i].pModeSet = &pResult->modeHash;
}
SResultRowCellInfo* pResInfo = pCtx[i].resultInfo;
......@@ -4124,7 +4124,7 @@ void setResultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, SResultRow *pResult, SQLF
if (pCtx[i].functionId == TSDB_FUNC_UNIQUE) {
pCtx[i].pUniqueSet = &pResult->uniqueHash;
}else if (pCtx[i].functionId == TSDB_FUNC_MODE) {
pCtx[i].pUniqueSet = &pResult->modeHash;
pCtx[i].pModeSet = &pResult->modeHash;
}
}
}
......
......@@ -92,6 +92,10 @@ void cleanupResultRowInfo(SResultRowInfo *pResultRowInfo) {
taosHashCleanup(pResultRowInfo->pResult[i]->uniqueHash);
pResultRowInfo->pResult[i]->uniqueHash = NULL;
}
if (pResultRowInfo->pResult[i]->modeHash){
taosHashCleanup(pResultRowInfo->pResult[i]->modeHash);
pResultRowInfo->pResult[i]->modeHash = NULL;
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册