refactor: do some internal refactor.

This commit is contained in:
Haojun Liao 2023-04-28 09:19:53 +08:00
parent 8205168428
commit 6482ef9ad1
1 changed files with 7 additions and 10 deletions

View File

@ -80,7 +80,8 @@ int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHand
int32_t vgId, char* sql, EOPTR_EXEC_MODEL model) { int32_t vgId, char* sql, EOPTR_EXEC_MODEL model) {
*pTaskInfo = doCreateTask(pPlan->id.queryId, taskId, vgId, model); *pTaskInfo = doCreateTask(pPlan->id.queryId, taskId, vgId, model);
if (*pTaskInfo == NULL) { if (*pTaskInfo == NULL) {
goto _complete; taosMemoryFree(sql);
return terrno;
} }
if (pHandle) { if (pHandle) {
@ -96,16 +97,12 @@ int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHand
pPlan->user, pPlan->dbFName); pPlan->user, pPlan->dbFName);
if (NULL == (*pTaskInfo)->pRoot) { if (NULL == (*pTaskInfo)->pRoot) {
terrno = (*pTaskInfo)->code; int32_t code = (*pTaskInfo)->code;
goto _complete; doDestroyTask(*pTaskInfo);
return code;
} else {
return TSDB_CODE_SUCCESS;
} }
return TSDB_CODE_SUCCESS;
_complete:
taosMemoryFree(sql);
doDestroyTask(*pTaskInfo);
return terrno;
} }
void cleanupQueriedTableScanInfo(SSchemaInfo* pSchemaInfo) { void cleanupQueriedTableScanInfo(SSchemaInfo* pSchemaInfo) {