switch the sync query model to async query model

This commit is contained in:
hjxilinx 2020-03-08 17:15:15 +08:00
parent cacd0b71d5
commit 1c14e570b1
2 changed files with 19 additions and 3 deletions

View File

@ -783,7 +783,13 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
/* Query rsp is not received from vnode, so the qhandle is NULL */
tscTrace("%p qhandle is null, abort free, fp:%p", pSql, pSql->fp);
if (pSql->fp != NULL) {
tscFreeSqlObj(pSql);
STscObj* pObj = pSql->pTscObj;
if (pSql == pObj->pSql) {
pObj->pSql = NULL;
tscFreeSqlObj(pSql);
}
tscTrace("%p Async SqlObj is freed by app", pSql);
} else if (keepCmd) {
tscFreeSqlResult(pSql);
@ -850,6 +856,11 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
tscFreeSqlObjPartial(pSql);
tscTrace("%p sql result is freed by app", pSql);
}
} else { // for async release, remove its link
STscObj* pObj = pSql->pTscObj;
if (pObj->pSql == pSql) {
pObj->pSql = NULL;
}
}
} else {
// if no free resource msg is sent to vnode, we free this object immediately.

View File

@ -465,6 +465,11 @@ void tscFreeSqlObjPartial(SSqlObj* pSql) {
tfree(pSql->pSubs);
pSql->numOfSubs = 0;
pSql->freed = 0;
tscFreeSqlCmdData(pCmd);
tscTrace("%p free sqlObj partial completed", pSql);
tscFreeSqlCmdData(pCmd);
}