提交 eb239b13 编写于 作者: A Alex Duan

[TS-238]<feature>: support last() cache ok if delete last

上级 f3cf8d5b
...@@ -845,9 +845,8 @@ int tsdbRestoreLastRow(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh, SBlockI ...@@ -845,9 +845,8 @@ int tsdbRestoreLastRow(STsdbRepo *pRepo, STable *pTable, SReadH* pReadh, SBlockI
// during the load data in file, new data would be inserted and last row has been updated // during the load data in file, new data would be inserted and last row has been updated
TSDB_WLOCK_TABLE(pTable); TSDB_WLOCK_TABLE(pTable);
if (onlyKey) {
pTable->lastKey = lastKey; pTable->lastKey = lastKey;
} else { if (!onlyKey) {
// set // set
if (pTable->lastRow) { if (pTable->lastRow) {
SMemRow* p = pTable->lastRow; SMemRow* p = pTable->lastRow;
...@@ -956,7 +955,7 @@ int32_t tsdbLoadLastCache(STsdbRepo *pRepo, STable *pTable, bool force) { ...@@ -956,7 +955,7 @@ int32_t tsdbLoadLastCache(STsdbRepo *pRepo, STable *pTable, bool force) {
taosTZfree(pTable->lastRow); taosTZfree(pTable->lastRow);
pTable->lastRow = NULL; pTable->lastRow = NULL;
} }
if (!cacheLastCol && pTable->lastCols != NULL) { if ((!cacheLastCol && pTable->lastCols != NULL) || force) {
tsdbFreeLastColumns(pTable); tsdbFreeLastColumns(pTable);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册