[td-4372]<fix>: fix the taosd server crash caused by dropping a child table, of which the indexed tag value is null.

This commit is contained in:
Haojun Liao 2021-05-27 11:18:04 +08:00
parent f0a7a53375
commit 44b5fc4732
1 changed files with 5 additions and 0 deletions

View File

@ -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);