fix deadlocks while free resultset

This commit is contained in:
Shengliang Guan 2020-06-02 15:00:31 +08:00
parent 14333f31ab
commit 1a5138b3ae
2 changed files with 3 additions and 2 deletions

View File

@ -1715,6 +1715,7 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) {
pParentObj->res.numOfRows += numOfRows;
}
taos_free_result(tres);
int32_t completed = atomic_add_fetch_32(&pState->numOfCompleted, 1);
if (completed < total) {
return;
@ -1732,7 +1733,7 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) {
pParentObj->fp = pParentObj->fetchFp;
// all data has been sent to vnode, call user function
(*pParentObj->fp)(pParentObj->param, tres, numOfRows);
(*pParentObj->fp)(pParentObj->param, pParentObj, numOfRows);
}
int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {

View File

@ -771,11 +771,11 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
}
}
taos_free_result(pSql);
} else {
numOfRows = taos_affected_rows(pSql);
}
taos_free_result(pSql);
sprintf(script->rows, "%d", numOfRows);
script->linePos++;