diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index f22a2c093fcd673d5bfb025266375b8e6f1a02b9..8aed53895b6d5211fca4e6b0f5fd8017962f69bb 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -112,6 +112,8 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) { STsdbRepo *pRepo = (STsdbRepo *)repo; STsdbMeta *pMeta = pRepo->tsdbMeta; uint64_t uid = tableId.uid; + int tid = 0; + char * tbname = NULL; STable *pTable = tsdbGetTableByUid(pMeta, uid); if (pTable == NULL) { @@ -121,6 +123,13 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) { return -1; } + tid = TABLE_TID(pTable); + tbname = strdup(TABLE_CHAR_NAME(pTable)); + if (tbname == NULL) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; + return -1; + } + if (TABLE_TYPE(pTable) == TSDB_STREAM_TABLE) { if (pTable->cqhandle) pRepo->appH.cqDropFunc(pTable->cqhandle); } @@ -140,8 +149,8 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) { tsdbRemoveTableFromMeta(pRepo, pTable, true); - tsdbTrace("vgId:%d, table %s is dropped! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, varDataVal(pTable->name), - tableId.tid, tableId.uid); + tsdbTrace("vgId:%d, table %s is dropped! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, tbname, tid, uid); + free(tbname); return 0; }