fix query problem

This commit is contained in:
Hongze Cheng 2022-06-07 02:19:05 +00:00
parent aae7f8361d
commit ae3434222d
1 changed files with 7 additions and 1 deletions

View File

@ -514,7 +514,13 @@ static int32_t tsdbGetOrCreateTbData(SMemTable *pMemTable, tb_uid_t suid, tb_uid
SL_NODE_FORWARD(pTbData->sl.pTail, iLevel) = NULL;
}
if (taosArrayInsert(pMemTable->aTbData, idx < 0 ? 0 : idx, &pTbData) == NULL) {
void *p;
if (idx < 0) {
p = taosArrayPush(pMemTable->aTbData, &pTbData);
} else {
p = taosArrayInsert(pMemTable->aTbData, idx, &pTbData);
}
if (p == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto _err;
}