Merge pull request #5474 from taosdata/hotfix/TD-3348
[TD-3348]sqlobj already released when async error returns
This commit is contained in:
commit
eb2eada0e2
|
@ -281,7 +281,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) {
|
|||
}
|
||||
|
||||
static void tscAsyncResultCallback(SSchedMsg *pMsg) {
|
||||
SSqlObj* pSql = pMsg->ahandle;
|
||||
SSqlObj* pSql = (SSqlObj*)taosAcquireRef(tscObjRef, (int64_t)pMsg->ahandle);
|
||||
if (pSql == NULL || pSql->signature != pSql) {
|
||||
tscDebug("%p SqlObj is freed, not add into queue async res", pSql);
|
||||
return;
|
||||
|
@ -292,23 +292,26 @@ static void tscAsyncResultCallback(SSchedMsg *pMsg) {
|
|||
|
||||
SSqlRes *pRes = &pSql->res;
|
||||
if (pSql->fp == NULL || pSql->fetchFp == NULL){
|
||||
taosReleaseRef(tscObjRef, pSql->self);
|
||||
return;
|
||||
}
|
||||
|
||||
pSql->fp = pSql->fetchFp;
|
||||
(*pSql->fp)(pSql->param, pSql, pRes->code);
|
||||
taosReleaseRef(tscObjRef, pSql->self);
|
||||
}
|
||||
|
||||
void tscAsyncResultOnError(SSqlObj* pSql) {
|
||||
SSchedMsg schedMsg = {0};
|
||||
schedMsg.fp = tscAsyncResultCallback;
|
||||
schedMsg.ahandle = pSql;
|
||||
schedMsg.ahandle = (void *)pSql->self;
|
||||
schedMsg.thandle = (void *)1;
|
||||
schedMsg.msg = 0;
|
||||
taosScheduleTask(tscQhandle, &schedMsg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int tscSendMsgToServer(SSqlObj *pSql);
|
||||
|
||||
void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
|
||||
|
|
Loading…
Reference in New Issue