errr while config table

This commit is contained in:
Shengliang Guan 2020-06-03 02:37:16 +00:00
parent 8a5fa81b71
commit 46138ef492
1 changed files with 7 additions and 5 deletions

View File

@ -1352,11 +1352,13 @@ static void *mnodeBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableO
int32_t tagDataLen = 0;
int32_t totalCols = 0;
int32_t contLen = 0;
if (pTable->info.type == TSDB_CHILD_TABLE && pMsg != NULL) {
pTagData = (STagData*)pMsg->schema;
tagDataLen = ntohl(pTagData->dataLen);
if (pTable->info.type == TSDB_CHILD_TABLE) {
totalCols = pTable->superTable->numOfColumns + pTable->superTable->numOfTags;
contLen = sizeof(SMDCreateTableMsg) + totalCols * sizeof(SSchema) + tagDataLen + pTable->sqlLen;
if (pMsg != NULL) {
pTagData = (STagData *)pMsg->schema;
tagDataLen = ntohl(pTagData->dataLen);
}
} else {
totalCols = pTable->numOfColumns;
contLen = sizeof(SMDCreateTableMsg) + totalCols * sizeof(SSchema) + pTable->sqlLen;
@ -1406,11 +1408,11 @@ static void *mnodeBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableO
pSchema++;
}
if (pTable->info.type == TSDB_CHILD_TABLE && pMsg != NULL) {
if (pTable->info.type == TSDB_CHILD_TABLE && pTagData != NULL) {
memcpy(pCreate->data + totalCols * sizeof(SSchema), pTagData->data, tagDataLen);
}
if (pTable->info.type == TSDB_STREAM_TABLE && pMsg != NULL) {
if (pTable->info.type == TSDB_STREAM_TABLE) {
memcpy(pCreate->data + totalCols * sizeof(SSchema), pTable->sql, pTable->sqlLen);
}