fix crash
This commit is contained in:
parent
40f6fad49f
commit
15ba5769e0
|
@ -2670,7 +2670,6 @@ bool topBotFunctionSetup(SqlFunctionCtx* pCtx, SResultRowEntryInfo* pResInfo) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
|
|
||||||
pRes->maxSize = pCtx->param[1].param.i;
|
pRes->maxSize = pCtx->param[1].param.i;
|
||||||
pRes->type = pInput->pData[0]->info.type;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2695,7 +2694,8 @@ int32_t topFunction(SqlFunctionCtx* pCtx) {
|
||||||
SInputColumnInfoData* pInput = &pCtx->input;
|
SInputColumnInfoData* pInput = &pCtx->input;
|
||||||
SColumnInfoData* pCol = pInput->pData[0];
|
SColumnInfoData* pCol = pInput->pData[0];
|
||||||
|
|
||||||
int16_t type = pInput->pData[0]->info.type;
|
STopBotRes* pRes = getTopBotOutputInfo(pCtx);
|
||||||
|
pRes->type = pInput->pData[0]->info.type;
|
||||||
|
|
||||||
int32_t start = pInput->startRowIndex;
|
int32_t start = pInput->startRowIndex;
|
||||||
for (int32_t i = start; i < pInput->numOfRows + start; ++i) {
|
for (int32_t i = start; i < pInput->numOfRows + start; ++i) {
|
||||||
|
@ -2705,7 +2705,7 @@ int32_t topFunction(SqlFunctionCtx* pCtx) {
|
||||||
|
|
||||||
numOfElems++;
|
numOfElems++;
|
||||||
char* data = colDataGetData(pCol, i);
|
char* data = colDataGetData(pCol, i);
|
||||||
doAddIntoResult(pCtx, data, i, pCtx->pSrcBlock, type, pInput->uid, pResInfo, true);
|
doAddIntoResult(pCtx, data, i, pCtx->pSrcBlock, pRes->type, pInput->uid, pResInfo, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue