Merge pull request #3905 from taosdata/feature/os

TD-1743
This commit is contained in:
Shengliang Guan 2020-10-19 11:36:09 +08:00 committed by GitHub
commit 6fea1f4340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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,