From c86cc2f40a57bc3fefa9507ac652a22b3e5648b2 Mon Sep 17 00:00:00 2001 From: hzcheng Date: Tue, 12 May 2020 03:19:47 +0000 Subject: [PATCH] fix drop table coredump --- src/tsdb/src/tsdbMeta.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index 4c5de4a862..32913de33a 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -409,7 +409,7 @@ int tsdbDropTable(TsdbRepoT *repo, STableId tableId) { return -1; } - tsdbTrace("vgId %d: table is dropped! tid %s, uid " PRId64, pRepo->config.tsdbId, tableId.tid, tableId.uid); + tsdbTrace("vgId %d: table is dropped! tid %d, uid " PRId64, pRepo->config.tsdbId, tableId.tid, tableId.uid); if (tsdbRemoveTableFromMeta(pMeta, pTable) < 0) return -1; return 0; @@ -503,7 +503,9 @@ static int tsdbRemoveTableFromMeta(STsdbMeta *pMeta, STable *pTable) { if (pTable->type == TSDB_SUPER_TABLE) { SSkipListIterator *pIter = tSkipListCreateIter(pTable->pIndex); while (tSkipListIterNext(pIter)) { - STable *tTable = *(STable **)SL_GET_NODE_DATA(tSkipListIterGet(pIter)); + STableIndexElem *pEle = (STableIndexElem *)SL_GET_NODE_DATA(tSkipListIterGet(pIter)); + STable *tTable = pEle->pTable; + ASSERT(tTable != NULL && tTable->type == TSDB_CHILD_TABLE); pMeta->tables[tTable->tableId.tid] = NULL; -- GitLab