fix: show obj
This commit is contained in:
parent
31d38dfd23
commit
f297f67698
|
@ -457,6 +457,7 @@ typedef struct {
|
||||||
void* pIter;
|
void* pIter;
|
||||||
SMnode* pMnode;
|
SMnode* pMnode;
|
||||||
STableMetaRsp* pMeta;
|
STableMetaRsp* pMeta;
|
||||||
|
bool resume;
|
||||||
bool sysDbRsp;
|
bool sysDbRsp;
|
||||||
char db[TSDB_DB_FNAME_LEN];
|
char db[TSDB_DB_FNAME_LEN];
|
||||||
char filterTb[TSDB_TABLE_NAME_LEN];
|
char filterTb[TSDB_TABLE_NAME_LEN];
|
||||||
|
|
|
@ -133,6 +133,7 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SRetrieveTableReq *pReq) {
|
||||||
showObj.id = showId;
|
showObj.id = showId;
|
||||||
showObj.pMnode = pMnode;
|
showObj.pMnode = pMnode;
|
||||||
showObj.type = convertToRetrieveType(pReq->tb, tListLen(pReq->tb));
|
showObj.type = convertToRetrieveType(pReq->tb, tListLen(pReq->tb));
|
||||||
|
showObj.resume = false;
|
||||||
memcpy(showObj.db, pReq->db, TSDB_DB_FNAME_LEN);
|
memcpy(showObj.db, pReq->db, TSDB_DB_FNAME_LEN);
|
||||||
strncpy(showObj.filterTb, pReq->filterTb, TSDB_TABLE_NAME_LEN);
|
strncpy(showObj.filterTb, pReq->filterTb, TSDB_TABLE_NAME_LEN);
|
||||||
|
|
||||||
|
@ -324,7 +325,8 @@ static int32_t mndProcessRetrieveSysTableReq(SRpcMsg *pReq) {
|
||||||
pReq->info.rsp = pRsp;
|
pReq->info.rsp = pRsp;
|
||||||
pReq->info.rspLen = size;
|
pReq->info.rspLen = size;
|
||||||
|
|
||||||
if (rowsRead == 0 || ((rowsRead < rowsToRead) && !pShow->pIter)) {
|
// if (rowsRead == 0 || ((rowsRead < rowsToRead) && !pShow->resume)) {
|
||||||
|
if (rowsRead == 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(pShow, true);
|
mndReleaseShowObj(pShow, true);
|
||||||
|
|
|
@ -3113,7 +3113,8 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
|
||||||
|
|
||||||
char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
|
char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
|
||||||
STR_TO_VARSTR(typeName, "SUPER_TABLE");
|
STR_TO_VARSTR(typeName, "SUPER_TABLE");
|
||||||
bool fetch = pShow->pIter ? false : true;
|
bool fetch = pShow->resume ? false : true;
|
||||||
|
pShow->resume = false;
|
||||||
while (numOfRows < rows) {
|
while (numOfRows < rows) {
|
||||||
if (fetch) {
|
if (fetch) {
|
||||||
pShow->pIter = sdbFetch(pSdb, SDB_STB, pShow->pIter, (void **)&pStb);
|
pShow->pIter = sdbFetch(pSdb, SDB_STB, pShow->pIter, (void **)&pStb);
|
||||||
|
@ -3138,6 +3139,7 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((numOfRows + pStb->numOfColumns) > rows) {
|
if ((numOfRows + pStb->numOfColumns) > rows) {
|
||||||
|
pShow->resume = true;
|
||||||
if (numOfRows == 0) {
|
if (numOfRows == 0) {
|
||||||
mError("mndRetrieveStbCol failed to get stable cols since buf:%d less than result:%d, stable name:%s, db:%s",
|
mError("mndRetrieveStbCol failed to get stable cols since buf:%d less than result:%d, stable name:%s, db:%s",
|
||||||
rows, pStb->numOfColumns, pStb->name, pStb->db);
|
rows, pStb->numOfColumns, pStb->name, pStb->db);
|
||||||
|
|
Loading…
Reference in New Issue