From 0b3fb779c066c8b47c31c04d5ce5acad14427c7a Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 19 Oct 2020 02:48:16 +0000 Subject: [PATCH] TD-1743 --- src/mnode/src/mnodeTable.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index e100fc127b..8545e8790d 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1399,16 +1399,20 @@ int32_t mnodeRetrieveShowSuperTables(SShowObj *pShow, char *data, int32_t rows, void mnodeDropAllSuperTables(SDbObj *pDropDb) { void * pIter= NULL; int32_t numOfTables = 0; - int32_t dbNameLen = strlen(pDropDb->name); SSuperTableObj *pTable = NULL; + char prefix[64] = {0}; + tstrncpy(prefix, pDropDb->name, 64); + strcat(prefix, TS_PATH_DELIMITER); + int32_t prefixLen = strlen(prefix); + mInfo("db:%s, all super tables will be dropped from sdb", pDropDb->name); while (1) { pIter = mnodeGetNextSuperTable(pIter, &pTable); if (pTable == NULL) break; - if (strncmp(pDropDb->name, pTable->info.tableId, dbNameLen) == 0) { + if (strncmp(prefix, pTable->info.tableId, prefixLen) == 0) { SSdbOper oper = { .type = SDB_OPER_LOCAL, .table = tsSuperTableSdb, -- GitLab