minor changes
This commit is contained in:
parent
3b5828c0d4
commit
ff77967299
|
@ -859,7 +859,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *stbs, int32_t num
|
||||||
stb->tversion = ntohs(stb->tversion);
|
stb->tversion = ntohs(stb->tversion);
|
||||||
|
|
||||||
if ((contLen + sizeof(STableMetaRsp)) > bufSize) {
|
if ((contLen + sizeof(STableMetaRsp)) > bufSize) {
|
||||||
bufSize = contLen + (num -i) * (sizeof(STableMetaRsp) + 4 * sizeof(SSchema));
|
bufSize = contLen + (num - i) * (sizeof(STableMetaRsp) + 4 * sizeof(SSchema));
|
||||||
buf = realloc(buf, bufSize);
|
buf = realloc(buf, bufSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -908,7 +908,7 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *stbs, int32_t num
|
||||||
contLen += sizeof(STableMetaRsp) + len;
|
contLen += sizeof(STableMetaRsp) + len;
|
||||||
|
|
||||||
if (contLen > bufSize) {
|
if (contLen > bufSize) {
|
||||||
bufSize = contLen + (num -i - 1) * (sizeof(STableMetaRsp) + 4 * sizeof(SSchema));
|
bufSize = contLen + (num - i - 1) * (sizeof(STableMetaRsp) + 4 * sizeof(SSchema));
|
||||||
buf = realloc(buf, bufSize);
|
buf = realloc(buf, bufSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -921,14 +921,24 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *stbs, int32_t num
|
||||||
pRsp->suid = htobe64(pStb->uid);
|
pRsp->suid = htobe64(pStb->uid);
|
||||||
pRsp->tuid = htobe64(pStb->uid);
|
pRsp->tuid = htobe64(pStb->uid);
|
||||||
|
|
||||||
for (int32_t i = 0; i < totalCols; ++i) {
|
for (int32_t i = 0; i < pStb->numOfColumns; ++i) {
|
||||||
SSchema *pSchema = &pRsp->pSchema[i];
|
SSchema *pSchema = &pRsp->pSchema[i];
|
||||||
SSchema *pSrcSchema = &pStb->pSchema[i];
|
SSchema *pSrcSchema = &pStb->pColumns[i];
|
||||||
memcpy(pSchema->name, pSrcSchema->name, TSDB_COL_NAME_LEN);
|
memcpy(pSchema->name, pSrcSchema->name, TSDB_COL_NAME_LEN);
|
||||||
pSchema->type = pSrcSchema->type;
|
pSchema->type = pSrcSchema->type;
|
||||||
pSchema->colId = htonl(pSrcSchema->colId);
|
pSchema->colId = htonl(pSrcSchema->colId);
|
||||||
pSchema->bytes = htonl(pSrcSchema->bytes);
|
pSchema->bytes = htonl(pSrcSchema->bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < pStb->numOfTags; ++i) {
|
||||||
|
SSchema *pSchema = &pRsp->pSchema[i + pStb->numOfColumns];
|
||||||
|
SSchema *pSrcSchema = &pStb->pTags[i];
|
||||||
|
memcpy(pSchema->name, pSrcSchema->name, TSDB_COL_NAME_LEN);
|
||||||
|
pSchema->type = pSrcSchema->type;
|
||||||
|
pSchema->colId = htonl(pSrcSchema->colId);
|
||||||
|
pSchema->bytes = htonl(pSrcSchema->bytes);
|
||||||
|
}
|
||||||
|
|
||||||
taosRUnLockLatch(&pStb->lock);
|
taosRUnLockLatch(&pStb->lock);
|
||||||
mndReleaseDb(pMnode, pDb);
|
mndReleaseDb(pMnode, pDb);
|
||||||
mndReleaseStb(pMnode, pStb);
|
mndReleaseStb(pMnode, pStb);
|
||||||
|
@ -946,7 +956,6 @@ int32_t mndValidateStbInfo(SMnode *pMnode, SSTableMetaVersion *stbs, int32_t num
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int32_t mndGetNumOfStbs(SMnode *pMnode, char *dbName, int32_t *pNumOfStbs) {
|
static int32_t mndGetNumOfStbs(SMnode *pMnode, char *dbName, int32_t *pNumOfStbs) {
|
||||||
SSdb *pSdb = pMnode->pSdb;
|
SSdb *pSdb = pMnode->pSdb;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue