提交 7f9df4c3 编写于 作者: H Hongze Cheng

TD-353

上级 496c5da8
...@@ -112,6 +112,8 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) { ...@@ -112,6 +112,8 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) {
STsdbRepo *pRepo = (STsdbRepo *)repo; STsdbRepo *pRepo = (STsdbRepo *)repo;
STsdbMeta *pMeta = pRepo->tsdbMeta; STsdbMeta *pMeta = pRepo->tsdbMeta;
uint64_t uid = tableId.uid; uint64_t uid = tableId.uid;
int tid = 0;
char * tbname = NULL;
STable *pTable = tsdbGetTableByUid(pMeta, uid); STable *pTable = tsdbGetTableByUid(pMeta, uid);
if (pTable == NULL) { if (pTable == NULL) {
...@@ -121,6 +123,13 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) { ...@@ -121,6 +123,13 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) {
return -1; 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 (TABLE_TYPE(pTable) == TSDB_STREAM_TABLE) {
if (pTable->cqhandle) pRepo->appH.cqDropFunc(pTable->cqhandle); if (pTable->cqhandle) pRepo->appH.cqDropFunc(pTable->cqhandle);
} }
...@@ -140,8 +149,8 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) { ...@@ -140,8 +149,8 @@ int tsdbDropTable(TSDB_REPO_T *repo, STableId tableId) {
tsdbRemoveTableFromMeta(pRepo, pTable, true); tsdbRemoveTableFromMeta(pRepo, pTable, true);
tsdbTrace("vgId:%d, table %s is dropped! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, varDataVal(pTable->name), tsdbTrace("vgId:%d, table %s is dropped! tid:%d, uid:%" PRId64, pRepo->config.tsdbId, tbname, tid, uid);
tableId.tid, tableId.uid); free(tbname);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册