From 45c8c4884828947fac9b8e9dd95ab00d03dc3162 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Wed, 25 May 2022 21:11:20 +0800 Subject: [PATCH] fix: index memory error --- source/libs/index/src/index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/index/src/index.c b/source/libs/index/src/index.c index 1faf1decb4..d60bde718d 100644 --- a/source/libs/index/src/index.c +++ b/source/libs/index/src/index.c @@ -565,7 +565,7 @@ static int64_t indexGetAvaialbleVer(SIndex* sIdx, IndexCache* cache) { taosThreadMutexUnlock(&tf->mtx); if (rd != NULL) { - ver += MAX(ver, rd->header.version) + 1; + ver = (ver > rd->header.version ? ver : rd->header.verion) + 1; indexInfo("header: %" PRId64 ", ver: %" PRId64 "", rd->header.version, ver); } tfileReaderUnRef(rd); -- GitLab