[td-225] fix bugs in rsp data using wrong connection handle
This commit is contained in:
parent
4ce8f84e7e
commit
d9622d9d8c
|
@ -65,14 +65,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
|
||||||
*/
|
*/
|
||||||
int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp** pRsp, int32_t* contLen, bool* continueExec);
|
int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp** pRsp, int32_t* contLen, bool* continueExec);
|
||||||
|
|
||||||
/**
|
void* qGetResultRetrieveMsg(qinfo_t qinfo);
|
||||||
* Decide if more results will be produced or not, NOTE: this function will increase the ref count of QInfo,
|
|
||||||
* so it can be only called once for each retrieve
|
|
||||||
*
|
|
||||||
* @param qinfo
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
bool qHasMoreResultsToRetrieve(qinfo_t qinfo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* kill current ongoing query and free query handle automatically
|
* kill current ongoing query and free query handle automatically
|
||||||
|
|
|
@ -6640,6 +6640,13 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
|
||||||
setQueryStatus(pQuery, QUERY_COMPLETED);
|
setQueryStatus(pQuery, QUERY_COMPLETED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* qGetResultRetrieveMsg(qinfo_t qinfo) {
|
||||||
|
SQInfo* pQInfo = (SQInfo*) qinfo;
|
||||||
|
assert(pQInfo != NULL);
|
||||||
|
|
||||||
|
return pQInfo->rspContext;
|
||||||
|
}
|
||||||
|
|
||||||
void freeqinfoFn(void *qhandle) {
|
void freeqinfoFn(void *qhandle) {
|
||||||
void** handle = qhandle;
|
void** handle = qhandle;
|
||||||
if (handle == NULL || *handle == NULL) {
|
if (handle == NULL || *handle == NULL) {
|
||||||
|
@ -6762,3 +6769,4 @@ void** qReleaseQInfo(void* pMgmt, void* pQInfo, bool needFree) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -166,12 +166,16 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
|
||||||
bool buildRes = qTableQuery(*handle); // do execute query
|
bool buildRes = qTableQuery(*handle); // do execute query
|
||||||
|
|
||||||
if (buildRes) { // build result rsp
|
if (buildRes) { // build result rsp
|
||||||
vDebug("vgId:%d, QInfo:%p, start to build result rsp after query paused", pVnode->vgId, *handle);
|
|
||||||
|
SReadMsg* pRetrieveMsg = qGetResultRetrieveMsg(*handle);
|
||||||
|
assert(pRetrieveMsg != NULL);
|
||||||
|
vDebug("vgId:%d, QInfo:%p, start to build result rsp after query paused, %p", pVnode->vgId, *handle, pRetrieveMsg->rpcMsg.handle);
|
||||||
|
pReadMsg->rpcMsg.handle = pRetrieveMsg->rpcMsg.handle; // update the connection info according to the retrieve connection
|
||||||
|
|
||||||
pRet = &pReadMsg->rspRet;
|
pRet = &pReadMsg->rspRet;
|
||||||
|
code = TSDB_CODE_QRY_HAS_RSP;
|
||||||
|
|
||||||
bool continueExec = false;
|
bool continueExec = false;
|
||||||
code = TSDB_CODE_QRY_HAS_RSP;
|
|
||||||
if ((code = qDumpRetrieveResult(*handle, (SRetrieveTableRsp **)&pRet->rsp, &pRet->len, &continueExec)) == TSDB_CODE_SUCCESS) {
|
if ((code = qDumpRetrieveResult(*handle, (SRetrieveTableRsp **)&pRet->rsp, &pRet->len, &continueExec)) == TSDB_CODE_SUCCESS) {
|
||||||
|
|
||||||
if (continueExec) {
|
if (continueExec) {
|
||||||
|
|
Loading…
Reference in New Issue