TD-353
This commit is contained in:
parent
496c5da86c
commit
7f9df4c361
|
@ -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) {
|
||||||
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) {
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue