diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 4e05e1ce4c7fea9719e6249bd4b8ed48e5dce4d4..cae67673e91f2e7625a641b78b22c2de9eff557d 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -198,6 +198,10 @@ void taos_fetch_rows_a(TAOS_RES *taosa, void (*fp)(void *, TAOS_RES *, int), voi SSqlRes *pRes = &pSql->res; SSqlCmd *pCmd = &pSql->cmd; + // user-defined callback function is stored in fetchFp + pSql->fetchFp = fp; + pSql->fp = tscAsyncFetchRowsProxy; + if (pRes->qhandle == 0) { tscError("qhandle is NULL"); pRes->code = TSDB_CODE_TSC_INVALID_QHANDLE; @@ -205,10 +209,6 @@ void taos_fetch_rows_a(TAOS_RES *taosa, void (*fp)(void *, TAOS_RES *, int), voi return; } - // user-defined callback function is stored in fetchFp - pSql->fetchFp = fp; - pSql->fp = tscAsyncFetchRowsProxy; - pSql->param = param; tscResetForNextRetrieve(pRes); diff --git a/src/plugins/http/src/httpContext.c b/src/plugins/http/src/httpContext.c index 98fba9cb3b3f39a70fd102721a022ad923e0e43c..cefcca78215da2267001099aa7f728527f481ffa 100644 --- a/src/plugins/http/src/httpContext.c +++ b/src/plugins/http/src/httpContext.c @@ -137,7 +137,7 @@ void httpReleaseContext(HttpContext *pContext) { assert(refCount >= 0); HttpContext **ppContext = pContext->ppContext; - httpDebug("context:%p, is releasd, data:%p refCount:%d", pContext, ppContext, refCount); + httpDebug("context:%p, is released, data:%p refCount:%d", pContext, ppContext, refCount); if (tsHttpServer.contextCache != NULL) { taosCacheRelease(tsHttpServer.contextCache, (void **)(&ppContext), false); diff --git a/src/plugins/http/src/httpSql.c b/src/plugins/http/src/httpSql.c index 580f5684acb9ad266e984471276b2ca7512d5289..d8ac170d6d749ae2bf6ed313081cb2a98ca09d2a 100644 --- a/src/plugins/http/src/httpSql.c +++ b/src/plugins/http/src/httpSql.c @@ -226,9 +226,9 @@ void httpProcessSingleSqlRetrieveCallBack(void *param, TAOS_RES *result, int num if (numOfRows < 0) { httpError("context:%p, fd:%d, ip:%s, user:%s, retrieve failed, code:%s", pContext, pContext->fd, pContext->ipstr, pContext->user, tstrerror(numOfRows)); - } - - taos_free_result(result); + } + + taos_free_result(result); if (encode->stopJsonFp) { (encode->stopJsonFp)(pContext, &pContext->singleCmd); diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 37defc3ccf4b961c090c69c5f0785927a18160bc..9d005cdb07a79d734c4f05126febc14d6fc8d624 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6545,13 +6545,14 @@ void** qRegisterQInfo(void* pMgmt, uint64_t qInfo) { SQueryMgmt *pQueryMgmt = pMgmt; if (pQueryMgmt->qinfoPool == NULL) { + qError("QInfo:%p failed to add qhandle into qMgmt, since qMgmt is closed", (void *)qInfo); return NULL; } pthread_mutex_lock(&pQueryMgmt->lock); if (pQueryMgmt->closed) { pthread_mutex_unlock(&pQueryMgmt->lock); - + qError("QInfo:%p failed to add qhandle into cache, since qMgmt is colsing", (void *)qInfo); return NULL; } else { uint64_t handleVal = (uint64_t) qInfo; diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index 987783711b2452b17c56568fe4c63ed506c51e30..f529b713cf659d923e64ba8bf49798a0dde0f195 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -108,9 +108,10 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) { if (code == TSDB_CODE_SUCCESS) { handle = qRegisterQInfo(pVnode->qMgmt, (uint64_t) pQInfo); if (handle == NULL) { // failed to register qhandle + vError("vgId:%d QInfo:%p register qhandle failed, return to app, code:%s", pVnode->vgId, (void *)pQInfo, + tstrerror(pRsp->code)); pRsp->code = TSDB_CODE_QRY_INVALID_QHANDLE; qDestroyQueryInfo(pQInfo); // destroy it directly - vError("vgId:%d QInfo:%p register qhandle failed, return to app, code:%s", pVnode->vgId, (void*) pQInfo, tstrerror(pRsp->code)); } else { assert(*handle == pQInfo); pRsp->qhandle = htobe64((uint64_t) pQInfo);