From 780a81c67cbeb897ffaad3edcfba888276ae18e5 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 9 Mar 2023 16:12:40 +0800 Subject: [PATCH] little fix --- source/common/src/tmsg.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index bb6ef9eedb..9ad7c72bc0 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -2219,7 +2219,10 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { if (tEncodeI8(&encoder, pReq->cacheLast) < 0) return -1; if (tEncodeI8(&encoder, pReq->replications) < 0) return -1; if (tEncodeI32(&encoder, pReq->sstTrigger) < 0) return -1; + + // 1st modification if (tEncodeI32(&encoder, pReq->minRows) < 0) return -1; + tEndEncode(&encoder); int32_t tlen = encoder.pos; @@ -2247,8 +2250,12 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) { if (tDecodeI8(&decoder, &pReq->cacheLast) < 0) return -1; if (tDecodeI8(&decoder, &pReq->replications) < 0) return -1; if (tDecodeI32(&decoder, &pReq->sstTrigger) < 0) return -1; + + // 1st modification if (!tDecodeIsEnd(&decoder)) { if (tDecodeI32(&decoder, &pReq->minRows) < 0) return -1; + } else { + pReq->minRows = -1; } tEndDecode(&decoder); -- GitLab