提交 9216c6fd 编写于 作者: S shenglian zhou

(query):fix core due to substate destruction and building hearbeat message at the same time

上级 a6dc37ab
......@@ -280,7 +280,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
// } else {
// pQdesc->stableQuery = 0;
// }
pthread_mutex_lock(&pSql->subState.mutex);
if (pSql->pSubs != NULL && pSql->subState.states != NULL) {
for (int32_t i = 0; i < pQdesc->numOfSub; ++i) {
SSqlObj *psub = pSql->pSubs[i];
......@@ -295,6 +295,7 @@ int tscBuildQueryStreamDesc(void *pMsg, STscObj *pObj) {
p += len;
}
}
pthread_mutex_unlock(&pSql->subState.mutex);
}
pQdesc->numOfSub = htonl(pQdesc->numOfSub);
......
......@@ -4518,6 +4518,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) {
pRes->final = finalBk;
pRes->numOfTotal = num;
pthread_mutex_lock(&pSql->subState.mutex);
for(int32_t i = 0; i < pSql->subState.numOfSub; ++i) {
taos_free_result(pSql->pSubs[i]);
}
......@@ -4525,6 +4526,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) {
tfree(pSql->pSubs);
tfree(pSql->subState.states);
pSql->subState.numOfSub = 0;
pthread_mutex_unlock(&pSql->subState.mutex);
pthread_mutex_destroy(&pSql->subState.mutex);
pSql->fp = fp;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册