[td-14392] fix show bug.
This commit is contained in:
parent
416952ddf8
commit
c39595639c
|
@ -310,6 +310,8 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
|
||||||
mError("failed to process show-retrieve req:%p since %s", pShow, terrstr());
|
mError("failed to process show-retrieve req:%p since %s", pShow, terrstr());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pShow->numOfReads = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowRetrieveFp retrieveFp = pMgmt->retrieveFps[pShow->type];
|
ShowRetrieveFp retrieveFp = pMgmt->retrieveFps[pShow->type];
|
||||||
|
@ -374,7 +376,7 @@ static int32_t mndProcessRetrieveSysTableReq(SNodeMsg *pReq) {
|
||||||
pReq->pRsp = pRsp;
|
pReq->pRsp = pRsp;
|
||||||
pReq->rspLen = size;
|
pReq->rspLen = size;
|
||||||
|
|
||||||
if (rowsRead == 0 || rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) {
|
if (rowsRead == 0 || rowsToRead == 0 || (rowsRead < rowsToRead)) {
|
||||||
pRsp->completed = 1;
|
pRsp->completed = 1;
|
||||||
mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
|
mDebug("show:0x%" PRIx64 ", retrieve completed", pShow->id);
|
||||||
mndReleaseShowObj((SShowObj*) pShow, true);
|
mndReleaseShowObj((SShowObj*) pShow, true);
|
||||||
|
|
|
@ -1608,7 +1608,6 @@ static int32_t mndRetrieveStb(SNodeMsg *pReq, SShowObj *pShow, char *data, int32
|
||||||
SStbObj *pStb = NULL;
|
SStbObj *pStb = NULL;
|
||||||
int32_t cols = 0;
|
int32_t cols = 0;
|
||||||
char *pWrite;
|
char *pWrite;
|
||||||
char prefix[TSDB_DB_FNAME_LEN] = {0};
|
|
||||||
|
|
||||||
SDbObj* pDb = NULL;
|
SDbObj* pDb = NULL;
|
||||||
if (strlen(pShow->db) > 0) {
|
if (strlen(pShow->db) > 0) {
|
||||||
|
|
|
@ -156,6 +156,8 @@ SArray* interResFromBinary(const char* data, int32_t len);
|
||||||
void freeInterResult(void* param);
|
void freeInterResult(void* param);
|
||||||
|
|
||||||
void initGroupResInfo(SGroupResInfo* pGroupResInfo, SResultRowInfo* pResultInfo);
|
void initGroupResInfo(SGroupResInfo* pGroupResInfo, SResultRowInfo* pResultInfo);
|
||||||
|
void initMultiResInfoFromArrayList(SGroupResInfo* pGroupResInfo, SArray* pArrayList);
|
||||||
|
|
||||||
void cleanupGroupResInfo(SGroupResInfo* pGroupResInfo);
|
void cleanupGroupResInfo(SGroupResInfo* pGroupResInfo);
|
||||||
bool hasRemainDataInCurrentGroup(SGroupResInfo* pGroupResInfo);
|
bool hasRemainDataInCurrentGroup(SGroupResInfo* pGroupResInfo);
|
||||||
bool hasRemainData(SGroupResInfo* pGroupResInfo);
|
bool hasRemainData(SGroupResInfo* pGroupResInfo);
|
||||||
|
|
|
@ -222,6 +222,16 @@ void initGroupResInfo(SGroupResInfo* pGroupResInfo, SResultRowInfo* pResultInfo)
|
||||||
assert(pGroupResInfo->index <= getNumOfTotalRes(pGroupResInfo));
|
assert(pGroupResInfo->index <= getNumOfTotalRes(pGroupResInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initMultiResInfoFromArrayList(SGroupResInfo* pGroupResInfo, SArray* pArrayList) {
|
||||||
|
if (pGroupResInfo->pRows != NULL) {
|
||||||
|
taosArrayDestroy(pGroupResInfo->pRows);
|
||||||
|
}
|
||||||
|
|
||||||
|
pGroupResInfo->pRows = pArrayList->pData;
|
||||||
|
pGroupResInfo->index = 0;
|
||||||
|
ASSERT(pGroupResInfo->index <= getNumOfTotalRes(pGroupResInfo));
|
||||||
|
}
|
||||||
|
|
||||||
bool hasRemainDataInCurrentGroup(SGroupResInfo* pGroupResInfo) {
|
bool hasRemainDataInCurrentGroup(SGroupResInfo* pGroupResInfo) {
|
||||||
if (pGroupResInfo->pRows == NULL) {
|
if (pGroupResInfo->pRows == NULL) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -5665,9 +5665,9 @@ static int32_t loadSysTableContentCb(void* param, const SDataBuf* pMsg, int32_t
|
||||||
|
|
||||||
SRetrieveMetaTableRsp* pRsp = pScanResInfo->pRsp;
|
SRetrieveMetaTableRsp* pRsp = pScanResInfo->pRsp;
|
||||||
pRsp->numOfRows = htonl(pRsp->numOfRows);
|
pRsp->numOfRows = htonl(pRsp->numOfRows);
|
||||||
pRsp->useconds = htobe64(pRsp->useconds);
|
pRsp->useconds = htobe64(pRsp->useconds);
|
||||||
pRsp->handle = htobe64(pRsp->handle);
|
pRsp->handle = htobe64(pRsp->handle);
|
||||||
pRsp->compLen = htonl(pRsp->compLen);
|
pRsp->compLen = htonl(pRsp->compLen);
|
||||||
} else {
|
} else {
|
||||||
operator->pTaskInfo->code = code;
|
operator->pTaskInfo->code = code;
|
||||||
}
|
}
|
||||||
|
@ -5824,6 +5824,10 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
|
||||||
// pInfo->totalBytes;
|
// pInfo->totalBytes;
|
||||||
return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes;
|
return (pInfo->pRes->info.rows == 0) ? NULL : pInfo->pRes;
|
||||||
} else { // load the meta from mnode of the given epset
|
} else { // load the meta from mnode of the given epset
|
||||||
|
if (pOperator->status == OP_EXEC_DONE) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int64_t startTs = taosGetTimestampUs();
|
int64_t startTs = taosGetTimestampUs();
|
||||||
|
|
||||||
pInfo->req.type = pInfo->type;
|
pInfo->req.type = pInfo->type;
|
||||||
|
@ -5863,6 +5867,10 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator, bool* newgroup) {
|
||||||
SRetrieveMetaTableRsp* pRsp = pInfo->pRsp;
|
SRetrieveMetaTableRsp* pRsp = pInfo->pRsp;
|
||||||
pInfo->req.showId = pRsp->handle;
|
pInfo->req.showId = pRsp->handle;
|
||||||
|
|
||||||
|
if (pRsp->numOfRows == 0 || pRsp->completed) {
|
||||||
|
pOperator->status = OP_EXEC_DONE;
|
||||||
|
}
|
||||||
|
|
||||||
if (pRsp->numOfRows == 0) {
|
if (pRsp->numOfRows == 0) {
|
||||||
// qDebug("%s vgId:%d, taskID:0x%"PRIx64" %d of total completed, rowsOfSource:%"PRIu64", totalRows:%"PRIu64"
|
// qDebug("%s vgId:%d, taskID:0x%"PRIx64" %d of total completed, rowsOfSource:%"PRIu64", totalRows:%"PRIu64"
|
||||||
// try next",
|
// try next",
|
||||||
|
@ -6993,6 +7001,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo *pOperator, bool* newgroup
|
||||||
|
|
||||||
finalizeUpdatedResult(pInfo->binfo.pCtx, pOperator->numOfOutput, pInfo->aggSup.pResultBuf, pUpdated, pInfo->binfo.rowCellInfoOffset);
|
finalizeUpdatedResult(pInfo->binfo.pCtx, pOperator->numOfOutput, pInfo->aggSup.pResultBuf, pUpdated, pInfo->binfo.rowCellInfoOffset);
|
||||||
|
|
||||||
|
initMultiResInfoFromArrayList(&pInfo->groupResInfo, pUpdated);
|
||||||
blockDataEnsureCapacity(pInfo->binfo.pRes, pInfo->binfo.capacity);
|
blockDataEnsureCapacity(pInfo->binfo.pRes, pInfo->binfo.capacity);
|
||||||
toSDatablock(&pInfo->groupResInfo, pInfo->aggSup.pResultBuf, pInfo->binfo.pRes, pInfo->binfo.capacity,
|
toSDatablock(&pInfo->groupResInfo, pInfo->aggSup.pResultBuf, pInfo->binfo.pRes, pInfo->binfo.capacity,
|
||||||
pInfo->binfo.rowCellInfoOffset);
|
pInfo->binfo.rowCellInfoOffset);
|
||||||
|
@ -8793,9 +8802,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
|
||||||
|
|
||||||
SSDataBlock* pResBlock = createOutputBuf_rv1(pScanPhyNode->node.pOutputDataBlockDesc);
|
SSDataBlock* pResBlock = createOutputBuf_rv1(pScanPhyNode->node.pOutputDataBlockDesc);
|
||||||
SArray* colList = extractScanColumnId(pScanPhyNode->pScanCols);
|
SArray* colList = extractScanColumnId(pScanPhyNode->pScanCols);
|
||||||
|
SOperatorInfo* pOperator = createStreamScanOperatorInfo(pHandle->reader, pResBlock, colList, tableIdList, pTaskInfo);
|
||||||
SOperatorInfo* pOperator =
|
|
||||||
createStreamScanOperatorInfo(pHandle->reader, pResBlock, colList, tableIdList, pTaskInfo);
|
|
||||||
taosArrayDestroy(tableIdList);
|
taosArrayDestroy(tableIdList);
|
||||||
return pOperator;
|
return pOperator;
|
||||||
} else if (QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN == nodeType(pPhyNode)) {
|
} else if (QUERY_NODE_PHYSICAL_PLAN_SYSTABLE_SCAN == nodeType(pPhyNode)) {
|
||||||
|
|
Loading…
Reference in New Issue