未验证 提交 b6d11287 编写于 作者: L Liu Jicong 提交者: GitHub

fix insert dump (#7779)

fix insert dump
上级 7f75c03a
...@@ -779,7 +779,7 @@ static int tsdbInsertDataToTable(STsdbRepo* pRepo, SSubmitBlk* pBlock, int32_t * ...@@ -779,7 +779,7 @@ static int tsdbInsertDataToTable(STsdbRepo* pRepo, SSubmitBlk* pBlock, int32_t *
int32_t points = 0; int32_t points = 0;
STable *pTable = NULL; STable *pTable = NULL;
SSubmitBlkIter blkIter = {0}; SSubmitBlkIter blkIter = {0};
SMemTable *pMemTable = NULL; SMemTable *pMemTable = pRepo->mem;
STableData *pTableData = NULL; STableData *pTableData = NULL;
STsdbCfg *pCfg = &(pRepo->config); STsdbCfg *pCfg = &(pRepo->config);
...@@ -787,17 +787,18 @@ static int tsdbInsertDataToTable(STsdbRepo* pRepo, SSubmitBlk* pBlock, int32_t * ...@@ -787,17 +787,18 @@ static int tsdbInsertDataToTable(STsdbRepo* pRepo, SSubmitBlk* pBlock, int32_t *
if(blkIter.row == NULL) return 0; if(blkIter.row == NULL) return 0;
TSKEY firstRowKey = memRowKey(blkIter.row); TSKEY firstRowKey = memRowKey(blkIter.row);
tsdbAllocBytes(pRepo, 0); if (pMemTable == NULL) {
pMemTable = pRepo->mem; pMemTable = tsdbNewMemTable(pRepo);
if (pMemTable == NULL) return -1;
pRepo->mem = pMemTable;
}
ASSERT(pMemTable != NULL);
ASSERT(pBlock->tid < pMeta->maxTables); ASSERT(pBlock->tid < pMeta->maxTables);
pTable = pMeta->tables[pBlock->tid]; pTable = pMeta->tables[pBlock->tid];
ASSERT(pTable != NULL && TABLE_UID(pTable) == pBlock->uid); ASSERT(pTable != NULL && TABLE_UID(pTable) == pBlock->uid);
if (TABLE_TID(pTable) >= pMemTable->maxTables) { if (TABLE_TID(pTable) >= pMemTable->maxTables) {
if (tsdbAdjustMemMaxTables(pMemTable, pMeta->maxTables) < 0) { if (tsdbAdjustMemMaxTables(pMemTable, pMeta->maxTables) < 0) {
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册