Merge pull request #5820 from taosdata/hotfix/TD-3768

[TD-3768]crash issue by query cancelled
This commit is contained in:
haojun Liao 2021-04-16 11:18:55 +08:00 committed by GitHub
commit b24b0a35d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -1879,8 +1879,9 @@ static void doFreeQueryHandle(SQueryRuntimeEnv* pRuntimeEnv) {
} }
static void destroyTsComp(SQueryRuntimeEnv *pRuntimeEnv, SQuery *pQuery) { static void destroyTsComp(SQueryRuntimeEnv *pRuntimeEnv, SQuery *pQuery) {
if (isTsCompQuery(pQuery)) { if (isTsCompQuery(pQuery) && pRuntimeEnv->outputBuf && pRuntimeEnv->outputBuf->pDataBlock && taosArrayGetSize(pRuntimeEnv->outputBuf->pDataBlock) > 0) {
SColumnInfoData* pColInfoData = taosArrayGet(pRuntimeEnv->outputBuf->pDataBlock, 0); SColumnInfoData* pColInfoData = taosArrayGet(pRuntimeEnv->outputBuf->pDataBlock, 0);
if (pColInfoData) {
FILE *f = *(FILE **)pColInfoData->pData; // TODO refactor FILE *f = *(FILE **)pColInfoData->pData; // TODO refactor
if (f) { if (f) {
fclose(f); fclose(f);
@ -1888,6 +1889,7 @@ static void destroyTsComp(SQueryRuntimeEnv *pRuntimeEnv, SQuery *pQuery) {
} }
} }
} }
}
static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) { static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
SQuery *pQuery = pRuntimeEnv->pQuery; SQuery *pQuery = pRuntimeEnv->pQuery;