提交 d9622d9d 编写于 作者: H Haojun Liao

[td-225] fix bugs in rsp data using wrong connection handle

上级 4ce8f84e
......@@ -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);
/**
* 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);
void* qGetResultRetrieveMsg(qinfo_t qinfo);
/**
* kill current ongoing query and free query handle automatically
......
......@@ -6640,6 +6640,13 @@ static void buildTagQueryResult(SQInfo* pQInfo) {
setQueryStatus(pQuery, QUERY_COMPLETED);
}
void* qGetResultRetrieveMsg(qinfo_t qinfo) {
SQInfo* pQInfo = (SQInfo*) qinfo;
assert(pQInfo != NULL);
return pQInfo->rspContext;
}
void freeqinfoFn(void *qhandle) {
void** handle = qhandle;
if (handle == NULL || *handle == NULL) {
......@@ -6762,3 +6769,4 @@ void** qReleaseQInfo(void* pMgmt, void* pQInfo, bool needFree) {
return 0;
}
......@@ -166,12 +166,16 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
bool buildRes = qTableQuery(*handle); // do execute query
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;
code = TSDB_CODE_QRY_HAS_RSP;
bool continueExec = false;
code = TSDB_CODE_QRY_HAS_RSP;
if ((code = qDumpRetrieveResult(*handle, (SRetrieveTableRsp **)&pRet->rsp, &pRet->len, &continueExec)) == TSDB_CODE_SUCCESS) {
if (continueExec) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册