提交 bec2b589 编写于 作者: L lichuang

[TD-4034]fix compile error

上级 6f202d27
...@@ -678,31 +678,31 @@ static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh) ...@@ -678,31 +678,31 @@ static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh)
loadStatisData = true; loadStatisData = true;
} }
for (uint32_t colId = 0; colId < numColumns && numColumns > pTable->restoreColumnNum; ++colId) { for (uint32_t i = 0; i < numColumns && numColumns > pTable->restoreColumnNum; ++i) {
STColumn *pCol = schemaColAt(pSchema, colId); STColumn *pCol = schemaColAt(pSchema, i);
if (colId >= pTable->lastColNum) { if (i >= pTable->lastColNum) {
pTable->lastCols = realloc(pTable->lastCols, colId + 5); pTable->lastCols = realloc(pTable->lastCols, i + 5);
for (int m = 0; m < 5; ++m) { for (int m = 0; m < 5; ++m) {
pTable->lastCols[m + pTable->lastColNum].bytes = 0; pTable->lastCols[m + pTable->lastColNum].bytes = 0;
pTable->lastCols[m + pTable->lastColNum].pData = NULL; pTable->lastCols[m + pTable->lastColNum].pData = NULL;
} }
pTable->lastColNum += colId + 5; pTable->lastColNum += i + 5;
} }
// ignore loaded columns // ignore loaded columns
if (pTable->lastCols[colId].bytes != 0) { if (pTable->lastCols[i].bytes != 0) {
continue; continue;
} }
// ignore block which has no not-null colId column // ignore block which has no not-null colId column
if (loadStatisData && pBlockStatis[colId].numOfNull == pBlock->numOfRows) { if (loadStatisData && pBlockStatis[i].numOfNull == pBlock->numOfRows) {
continue; continue;
} }
// OK,let's load row from backward to get not-null column // OK,let's load row from backward to get not-null column
for (int32_t rowId = pBlock->numOfRows - 1; rowId >= 0; rowId--) { for (int32_t rowId = pBlock->numOfRows - 1; rowId >= 0; rowId--) {
SDataCol *pDataCol = pReadh->pDCols[0]->cols + colId; SDataCol *pDataCol = pReadh->pDCols[0]->cols + i;
tdAppendColVal(row, tdGetColDataOfRow(pDataCol, rowId), pCol->type, pCol->bytes, pCol->offset); tdAppendColVal(row, tdGetColDataOfRow(pDataCol, rowId), pCol->type, pCol->bytes, pCol->offset);
//SDataCol *pDataCol = readh.pDCols[0]->cols + j; //SDataCol *pDataCol = readh.pDCols[0]->cols + j;
void* value = tdGetRowDataOfCol(row, (int8_t)pCol->type, TD_DATA_ROW_HEAD_SIZE + pCol->offset); void* value = tdGetRowDataOfCol(row, (int8_t)pCol->type, TD_DATA_ROW_HEAD_SIZE + pCol->offset);
...@@ -710,8 +710,8 @@ static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh) ...@@ -710,8 +710,8 @@ static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh)
continue; continue;
} }
// save not-null column // save not-null column
SDataCol *pLastCol = &(pTable->lastCols[colId]); SDataCol *pLastCol = &(pTable->lastCols[i]);
pLastCol->pData = malloc(pCol->bytes); pLastCol->pData = malloc(pCol->bytes);
pLastCol->bytes = pCol->bytes; pLastCol->bytes = pCol->bytes;
pLastCol->offset = pCol->offset; pLastCol->offset = pCol->offset;
...@@ -726,7 +726,7 @@ static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh) ...@@ -726,7 +726,7 @@ static int restoreLastColumns(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh)
pTable->restoreColumnNum += 1; pTable->restoreColumnNum += 1;
tsdbInfo("restoreLastColumns restore vgId:%d,table:%s cache column %d, %ld", REPO_ID(pRepo), pTable->name->data, colId, pLastCol->ts); tsdbInfo("restoreLastColumns restore vgId:%d,table:%s cache column %d, %d", REPO_ID(pRepo), pTable->name->data, pCol->colId, (int32_t)pLastCol->ts);
break; break;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册