fix deadlocks while free resultset
This commit is contained in:
parent
14333f31ab
commit
1a5138b3ae
|
@ -1715,6 +1715,7 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) {
|
||||||
pParentObj->res.numOfRows += numOfRows;
|
pParentObj->res.numOfRows += numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taos_free_result(tres);
|
||||||
int32_t completed = atomic_add_fetch_32(&pState->numOfCompleted, 1);
|
int32_t completed = atomic_add_fetch_32(&pState->numOfCompleted, 1);
|
||||||
if (completed < total) {
|
if (completed < total) {
|
||||||
return;
|
return;
|
||||||
|
@ -1732,7 +1733,7 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) {
|
||||||
pParentObj->fp = pParentObj->fetchFp;
|
pParentObj->fp = pParentObj->fetchFp;
|
||||||
|
|
||||||
// all data has been sent to vnode, call user function
|
// 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) {
|
int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
|
||||||
|
|
|
@ -771,11 +771,11 @@ bool simExecuteNativeSqlCommand(SScript *script, char *rest, bool isSlow) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
taos_free_result(pSql);
|
|
||||||
} else {
|
} else {
|
||||||
numOfRows = taos_affected_rows(pSql);
|
numOfRows = taos_affected_rows(pSql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taos_free_result(pSql);
|
||||||
sprintf(script->rows, "%d", numOfRows);
|
sprintf(script->rows, "%d", numOfRows);
|
||||||
|
|
||||||
script->linePos++;
|
script->linePos++;
|
||||||
|
|
Loading…
Reference in New Issue