From e1fdc40fe216344ce245e5b9e25f4ff72da92717 Mon Sep 17 00:00:00 2001 From: slguan Date: Wed, 25 Mar 2020 11:01:07 +0800 Subject: [PATCH] [TD-15] fix error while create child table --- src/mnode/src/mgmtChildTable.c | 5 ++--- src/mnode/src/mgmtNormalTable.c | 2 +- src/mnode/src/mgmtTable.c | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mnode/src/mgmtChildTable.c b/src/mnode/src/mgmtChildTable.c index 9076681caa..8fbf210118 100644 --- a/src/mnode/src/mgmtChildTable.c +++ b/src/mnode/src/mgmtChildTable.c @@ -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; diff --git a/src/mnode/src/mgmtNormalTable.c b/src/mnode/src/mgmtNormalTable.c index 4e5e4ce7cc..fde9db2d74 100644 --- a/src/mnode/src/mgmtNormalTable.c +++ b/src/mnode/src/mgmtNormalTable.c @@ -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; diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index 491e65979a..c9a0333b17 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -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; -- GitLab