From 9bbf36d35dec69990a58f771a049baebb5c684ae Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 10 May 2023 14:39:51 +0800 Subject: [PATCH] cache/serialize: keep original col value untouched --- source/dnode/vnode/src/tsdb/tsdbCache.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index cbf0ebe3ec..7d22e59b4a 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -180,11 +180,12 @@ void tsdbCacheSerialize(SLastCol *pLastCol, char **value, size_t *size) { *(SLastCol *)(*value) = *pLastCol; if (IS_VAR_DATA_TYPE(pColVal->type)) { uint8_t *pVal = pColVal->value.pData; - pColVal->value.pData = *value + sizeof(*pLastCol); + SColVal *pDColVal = &((SLastCol *)(*value))->colVal; + pDColVal->value.pData = *value + sizeof(*pLastCol); if (pColVal->value.nData > 0) { - memcpy(pColVal->value.pData, pVal, pColVal->value.nData); + memcpy(pDColVal->value.pData, pVal, pColVal->value.nData); } else { - pColVal->value.pData = NULL; + pDColVal->value.pData = NULL; } } *size = length; -- GitLab