diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 921702d866e2a1238ae8208451f55d2742b11732..c9554b5688a437dcadc2d09cef90e5a36adf1f26 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -139,7 +139,11 @@ int32_t tsdbCacheInsertLastrow(SLRUCache *pCache, STsdb *pTsdb, tb_uid_t uid, ST } else { taosLRUCacheRelease(pCache, h, true); // tsdbCacheDeleteLastrow(pCache, uid, TSKEY_MAX); - + if (dup) { + cacheRow = tdRowDup(row); + } else { + cacheRow = row; + } _taos_lru_deleter_t deleter = deleteTableCacheLastrow; LRUStatus status = taosLRUCacheInsert(pCache, key, keyLen, cacheRow, TD_ROW_LEN(cacheRow), deleter, NULL, TAOS_LRU_PRIORITY_LOW); diff --git a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c index c2dbd02035dfe96e9f8ea80b82d36adbf402ba04..30c097158fcd8c2ca1bc06911dc6981893f82ea1 100644 --- a/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c +++ b/source/dnode/vnode/src/tsdb/tsdbReaderWriter.c @@ -367,7 +367,7 @@ int32_t tsdbReadDelIdx(SDelFReader *pReader, SArray *aDelIdx, uint8_t **ppBuf) { int64_t size = pReader->fDel.size - offset; uint32_t delimiter; uint8_t *pBuf = NULL; - SDelIdx *pDelIdx = &(SDelIdx){}; + SDelIdx *pDelIdx = &(SDelIdx){0}; if (!ppBuf) ppBuf = &pBuf;