[td-225]
This commit is contained in:
parent
adcbb0fe40
commit
5adcf14d6e
|
@ -6227,6 +6227,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SSqlGroupbyExpr *pGrou
|
||||||
// NOTE: pTableCheckInfo need to update the query time range and the lastKey info
|
// NOTE: pTableCheckInfo need to update the query time range and the lastKey info
|
||||||
pQInfo->arrTableIdInfo = taosArrayInit(tableIndex, sizeof(STableIdInfo));
|
pQInfo->arrTableIdInfo = taosArrayInit(tableIndex, sizeof(STableIdInfo));
|
||||||
pQInfo->dataReady = QUERY_RESULT_NOT_READY;
|
pQInfo->dataReady = QUERY_RESULT_NOT_READY;
|
||||||
|
pQInfo->rspContext = NULL;
|
||||||
pthread_mutex_init(&pQInfo->lock, NULL);
|
pthread_mutex_init(&pQInfo->lock, NULL);
|
||||||
|
|
||||||
pQuery->pos = -1;
|
pQuery->pos = -1;
|
||||||
|
@ -6761,6 +6762,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
|
||||||
SQInfo *pQInfo = (SQInfo *)qinfo;
|
SQInfo *pQInfo = (SQInfo *)qinfo;
|
||||||
|
|
||||||
if (pQInfo == NULL || !isValidQInfo(pQInfo)) {
|
if (pQInfo == NULL || !isValidQInfo(pQInfo)) {
|
||||||
|
qError("QInfo:%p invalid qhandle", pQInfo);
|
||||||
return TSDB_CODE_QRY_INVALID_QHANDLE;
|
return TSDB_CODE_QRY_INVALID_QHANDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6773,6 +6775,8 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
|
||||||
|
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
pthread_mutex_lock(&pQInfo->lock);
|
pthread_mutex_lock(&pQInfo->lock);
|
||||||
|
assert(pQInfo->rspContext == NULL);
|
||||||
|
|
||||||
if (pQInfo->dataReady == QUERY_RESULT_READY) {
|
if (pQInfo->dataReady == QUERY_RESULT_READY) {
|
||||||
*buildRes = true;
|
*buildRes = true;
|
||||||
qDebug("QInfo:%p retrieve result info, rowsize:%d, rows:%"PRId64", code:%d", pQInfo, pQuery->rowSize, pQuery->rec.rows,
|
qDebug("QInfo:%p retrieve result info, rowsize:%d, rows:%"PRId64", code:%d", pQInfo, pQuery->rowSize, pQuery->rec.rows,
|
||||||
|
@ -6781,6 +6785,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo, bool* buildRes, void* pRspContex
|
||||||
*buildRes = false;
|
*buildRes = false;
|
||||||
qDebug("QInfo:%p retrieve req set query return result after paused", pQInfo);
|
qDebug("QInfo:%p retrieve req set query return result after paused", pQInfo);
|
||||||
pQInfo->rspContext = pRspContext;
|
pQInfo->rspContext = pRspContext;
|
||||||
|
assert(pQInfo->rspContext != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
code = pQInfo->code;
|
code = pQInfo->code;
|
||||||
|
|
|
@ -295,6 +295,8 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SReadMsg *pReadMsg) {
|
||||||
freeHandle = true;
|
freeHandle = true;
|
||||||
} else { // result is not ready, return immediately
|
} else { // result is not ready, return immediately
|
||||||
if (!buildRes) {
|
if (!buildRes) {
|
||||||
|
assert(pReadMsg->rpcMsg.handle != NULL);
|
||||||
|
|
||||||
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, false);
|
qReleaseQInfo(pVnode->qMgmt, (void **)&handle, false);
|
||||||
return TSDB_CODE_QRY_NOT_READY;
|
return TSDB_CODE_QRY_NOT_READY;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue