提交 1a5138b3 编写于 作者: S Shengliang Guan

fix deadlocks while free resultset

上级 14333f31
...@@ -1715,6 +1715,7 @@ static void multiVnodeInsertMerge(void* param, TAOS_RES* tres, int numOfRows) { ...@@ -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) { ...@@ -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) { ...@@ -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++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册