[TD-15] fix error while create child table

This commit is contained in:
slguan 2020-03-25 11:01:07 +08:00
parent 1a048a1028
commit e1fdc40fe2
3 changed files with 4 additions and 4 deletions

View File

@ -319,9 +319,8 @@ void* mgmtCreateChildTable(SCMCreateTableMsg *pCreate, SVgObj *pVgroup, int32_t
desc.type = SDB_OPER_TYPE_GLOBAL;
desc.pObj = pTable;
desc.table = tsChildTableSdb;
sdbInsertRow(&desc);
if (sdbInsertRow(&desc) < 0) {
if (sdbInsertRow(&desc) != TSDB_CODE_SUCCESS) {
free(pTable);
mError("ctable:%s, update sdb error", pCreate->tableId);
terrno = TSDB_CODE_SDB_ERROR;

View File

@ -334,7 +334,7 @@ void *mgmtCreateNormalTable(SCMCreateTableMsg *pCreate, SVgObj *pVgroup, int32_t
desc.type = SDB_OPER_TYPE_GLOBAL;
desc.pObj = pTable;
desc.table = tsNormalTableSdb;
if (sdbInsertRow(&desc) < 0) {
if (sdbInsertRow(&desc) != TSDB_CODE_SUCCESS) {
mError("table:%s, update sdb error", pTable->tableId);
free(pTable);
terrno = TSDB_CODE_SDB_ERROR;

View File

@ -287,6 +287,7 @@ int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows, void *
createdTime = pNormalTable->createdTime;
numOfColumns = pNormalTable->numOfColumns;
} else {
pShow->pNode = NULL;
void *pChildTableNode = sdbFetchRow(tsChildTableSdb, pShow->pNode, (void **) &pTable);
if (pTable != NULL) {
SChildTableObj *pChildTable = (SChildTableObj *) pTable;