From 44b5fc4732f97867c910fae80bcc2616c49a6e73 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 27 May 2021 11:18:04 +0800 Subject: [PATCH] [td-4372]: fix the taosd server crash caused by dropping a child table, of which the indexed tag value is null. --- src/tsdb/src/tsdbMeta.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index 3e6263b9d3..b074b04522 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -928,6 +928,11 @@ static int tsdbRemoveTableFromIndex(STsdbMeta *pMeta, STable *pTable) { STColumn *pCol = schemaColAt(pSchema, DEFAULT_TAG_INDEX_COLUMN); char * key = tdGetKVRowValOfCol(pTable->tagVal, pCol->colId); + if (key == NULL) { + // treat the column as NULL if we cannot find it + key = getNullValue(pCol->type); + } + SArray *res = tSkipListGet(pSTable->pIndex, key); size_t size = taosArrayGetSize(res);