diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index fb2f9fbb24444a2c5ede38f0a72565af45053c0c..c0ab75cadb29f9cf6deebdb29d02871e2de668b1 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -800,6 +800,11 @@ static int32_t mnodeGetStatusMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p strcpy(pSchema[0].name, "status"); pSchema[0].bytes = htons(pShow->bytes[0]); + pMeta->numOfColumns = htons(1); + pShow->numOfColumns = 1; + pShow->rowSize = sizeof(int32_t); + pShow->offset[0] = 0; + return 0; } @@ -807,6 +812,7 @@ static int32_t mnodeRetrieveStatus(SShowObj *pShow, char *data, int32_t rows, vo SVgObj *pVgroup = NULL; int32_t nAvailble = 0; int32_t nUnAvailble = 0; + int32_t numOfRows = 0; // get status while (numOfRows < rows) { @@ -828,7 +834,7 @@ static int32_t mnodeRetrieveStatus(SShowObj *pShow, char *data, int32_t rows, vo // check master bool master = false; - for (int32_t i = 0; i < pShow->maxReplica; ++i) { + for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { if (pVgroup->vnodeGid[i].role == TAOS_SYNC_ROLE_MASTER) { master = true; break; diff --git a/src/query/src/qTableMeta.c b/src/query/src/qTableMeta.c index f786f4438c2915299fa320818d7a36811eef40dd..6b459b1434b02feca06e7179f647afa75f27458d 100644 --- a/src/query/src/qTableMeta.c +++ b/src/query/src/qTableMeta.c @@ -72,7 +72,7 @@ SSchema* tscGetColumnSchemaById(STableMeta* pTableMeta, int16_t colId) { } STableMeta* tscCreateTableMetaFromMsg(STableMetaMsg* pTableMetaMsg) { - assert(pTableMetaMsg != NULL && pTableMetaMsg->numOfColumns >= 2); + //assert(pTableMetaMsg != NULL && pTableMetaMsg->numOfColumns >= 2); int32_t schemaSize = (pTableMetaMsg->numOfColumns + pTableMetaMsg->numOfTags) * sizeof(SSchema); STableMeta* pTableMeta = calloc(1, sizeof(STableMeta) + schemaSize);