From 563692222707e78a6bdda6f91b98c40db8406000 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 17 May 2022 02:52:46 +0000 Subject: [PATCH] fix: drop column --- source/dnode/vnode/src/meta/metaTable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 6bfcc34c85..1aec4185b0 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -420,7 +420,8 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl // get table entry SDecoder dc = {0}; tDecoderInit(&dc, pData, nData); - metaDecodeEntry(&dc, &entry); + ret = metaDecodeEntry(&dc, &entry); + ASSERT(ret == 0); if (entry.type != TSDB_NORMAL_TABLE) { terrno = TSDB_CODE_VND_INVALID_TABLE_ACTION; @@ -468,11 +469,11 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl goto _err; } pSchema->sver++; - pSchema->nCols--; tlen = (pSchema->nCols - iCol - 1) * sizeof(SSchema); if (tlen) { memmove(pColumn, pColumn + 1, tlen); } + pSchema->nCols--; break; case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES: if (pColumn == NULL) { -- GitLab