未验证 提交 fe5b898e 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #17430 from taosdata/fix/TD-19609

fix: fix case when crash issue
...@@ -1725,6 +1725,9 @@ static void destroyStateWindowOperatorInfo(void* param) { ...@@ -1725,6 +1725,9 @@ static void destroyStateWindowOperatorInfo(void* param) {
cleanupBasicInfo(&pInfo->binfo); cleanupBasicInfo(&pInfo->binfo);
taosMemoryFreeClear(pInfo->stateKey.pData); taosMemoryFreeClear(pInfo->stateKey.pData);
cleanupExprSupp(&pInfo->scalarSup); cleanupExprSupp(&pInfo->scalarSup);
colDataDestroy(&pInfo->twAggSup.timeWindowData);
cleanupAggSup(&pInfo->aggSup);
cleanupGroupResInfo(&pInfo->groupResInfo);
taosMemoryFreeClear(param); taosMemoryFreeClear(param);
} }
......
...@@ -629,6 +629,8 @@ _return: ...@@ -629,6 +629,8 @@ _return:
sclFreeParam(pWhen); sclFreeParam(pWhen);
sclFreeParam(pThen); sclFreeParam(pThen);
taosMemoryFree(pWhen);
taosMemoryFree(pThen);
SCL_RET(code); SCL_RET(code);
} }
...@@ -664,6 +666,8 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe ...@@ -664,6 +666,8 @@ int32_t sclWalkWhenList(SScalarCtx *ctx, SNodeList* pList, struct SListCell* pCe
sclFreeParam(pWhen); sclFreeParam(pWhen);
sclFreeParam(pThen); sclFreeParam(pThen);
taosMemoryFreeClear(pWhen);
taosMemoryFreeClear(pThen);
} }
if (pElse) { if (pElse) {
...@@ -688,6 +692,8 @@ _return: ...@@ -688,6 +692,8 @@ _return:
sclFreeParam(pWhen); sclFreeParam(pWhen);
sclFreeParam(pThen); sclFreeParam(pThen);
taosMemoryFree(pWhen);
taosMemoryFree(pThen);
SCL_RET(code); SCL_RET(code);
} }
...@@ -929,6 +935,10 @@ int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *outp ...@@ -929,6 +935,10 @@ int32_t sclExecCaseWhen(SCaseWhenNode *node, SScalarCtx *ctx, SScalarParam *outp
sclFreeParam(&comp); sclFreeParam(&comp);
sclFreeParam(pWhen); sclFreeParam(pWhen);
sclFreeParam(pThen); sclFreeParam(pThen);
taosMemoryFree(pCase);
taosMemoryFree(pElse);
taosMemoryFree(pWhen);
taosMemoryFree(pThen);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -940,6 +950,10 @@ _return: ...@@ -940,6 +950,10 @@ _return:
sclFreeParam(pWhen); sclFreeParam(pWhen);
sclFreeParam(pThen); sclFreeParam(pThen);
sclFreeParam(output); sclFreeParam(output);
taosMemoryFree(pCase);
taosMemoryFree(pElse);
taosMemoryFree(pWhen);
taosMemoryFree(pThen);
SCL_RET(code); SCL_RET(code);
} }
......
...@@ -654,7 +654,7 @@ int32_t vectorConvertSingleColImpl(const SScalarParam* pIn, SScalarParam* pOut, ...@@ -654,7 +654,7 @@ int32_t vectorConvertSingleColImpl(const SScalarParam* pIn, SScalarParam* pOut,
return TSDB_CODE_APP_ERROR; return TSDB_CODE_APP_ERROR;
} }
int32_t rstart = startIndex >= 0 ? startIndex : 0; int32_t rstart = (startIndex >= 0 && startIndex < pIn->numOfRows) ? startIndex : 0;
int32_t rend = numOfRows > 0 ? rstart + numOfRows - 1 : rstart + pIn->numOfRows - 1; int32_t rend = numOfRows > 0 ? rstart + numOfRows - 1 : rstart + pIn->numOfRows - 1;
SSclVectorConvCtx cCtx = {pIn, pOut, rstart, rend, pInputCol->info.type, pOutputCol->info.type}; SSclVectorConvCtx cCtx = {pIn, pOut, rstart, rend, pInputCol->info.type, pOutputCol->info.type};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册