[td-2819] refactor codes.

This commit is contained in:
Haojun Liao 2021-03-30 16:24:05 +08:00
parent 5dbe9cc590
commit 80c5a16c28
1 changed files with 4 additions and 13 deletions

View File

@ -1273,19 +1273,6 @@ void tscFieldInfoClear(SFieldInfo* pFieldInfo) {
if (pFieldInfo == NULL) {
return;
}
for(int32_t i = 0; i < pFieldInfo->numOfOutput; ++i) {
SInternalField* pInfo = taosArrayGet(pFieldInfo->internalField, i);
if (pInfo->pExpr != NULL && pInfo->pExpr->pExpr != NULL) {
tExprTreeDestroy(pInfo->pExpr->pExpr, NULL);
SSqlExpr* pSqlExpr = &pInfo->pExpr->base;
for(int32_t j = 0; j < pSqlExpr->numOfParams; ++j) {
tVariantDestroy(&pSqlExpr->param[j]);
}
}
}
taosArrayDestroy(pFieldInfo->internalField);
tfree(pFieldInfo->final);
@ -1436,6 +1423,10 @@ void* sqlExprDestroy(SExprInfo* pExpr) {
for(int32_t i = 0; i < tListLen(p->param); ++i) {
tVariantDestroy(&p->param[i]);
}
if (pExpr->pExpr != NULL) {
tExprTreeDestroy(pExpr->pExpr, NULL);
}
tfree(pExpr);