提交 d90c8e83 编写于 作者: K kailixu

chore: var def optimization

上级 828af14b
...@@ -457,7 +457,7 @@ typedef struct { ...@@ -457,7 +457,7 @@ typedef struct {
void* pIter; void* pIter;
SMnode* pMnode; SMnode* pMnode;
STableMetaRsp* pMeta; STableMetaRsp* pMeta;
bool resume; bool restore;
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];
......
...@@ -3113,8 +3113,8 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ...@@ -3113,8 +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->resume ? false : true; bool fetch = pShow->restore ? false : true;
pShow->resume = false; pShow->restore = 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);
...@@ -3139,7 +3139,7 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ...@@ -3139,7 +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; pShow->restore = 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);
......
...@@ -57,7 +57,7 @@ typedef struct SSysTableScanInfo { ...@@ -57,7 +57,7 @@ typedef struct SSysTableScanInfo {
const char* pUser; const char* pUser;
bool sysInfo; bool sysInfo;
bool showRewrite; bool showRewrite;
bool resume; bool restore;
SNode* pCondition; // db_name filter condition, to discard data that are not in current database SNode* pCondition; // db_name filter condition, to discard data that are not in current database
SMTbCursor* pCur; // cursor for iterate the local table meta store. SMTbCursor* pCur; // cursor for iterate the local table meta store.
SSysTableIndex* pIdx; // idx for local table meta SSysTableIndex* pIdx; // idx for local table meta
...@@ -529,10 +529,10 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { ...@@ -529,10 +529,10 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
return NULL; return NULL;
} }
int32_t resume = pInfo->resume; int32_t restore = pInfo->restore;
pInfo->resume = false; pInfo->restore = false;
while (resume || ((ret = metaTbCursorNext(pInfo->pCur, TSDB_TABLE_MAX)) == 0)) { while (restore || ((ret = metaTbCursorNext(pInfo->pCur, TSDB_TABLE_MAX)) == 0)) {
if (resume) resume = false; if (restore) restore = false;
char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; char typeName[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0}; char tableName[TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE] = {0};
...@@ -584,7 +584,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { ...@@ -584,7 +584,7 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) {
if ((numOfRows + schemaRow->nCols) > pOperator->resultInfo.capacity) { if ((numOfRows + schemaRow->nCols) > pOperator->resultInfo.capacity) {
relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo); relocateAndFilterSysTagsScanResult(pInfo, numOfRows, dataBlock, pOperator->exprSupp.pFilterInfo);
numOfRows = 0; numOfRows = 0;
pInfo->resume = true; pInfo->restore = true;
if (pInfo->pRes->info.rows > 0) { if (pInfo->pRes->info.rows > 0) {
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册