diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index fdcfcb02de470a23afd552be81292c31572fcc55..125e28f17778baead6b2be8d8409f2259d7d77e5 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -771,6 +771,10 @@ void tscSortRemoveDataBlockDupRowsRaw(STableDataBlocks *dataBuf) { TSKEY tj = *(TSKEY *)(pBlockData + dataBuf->rowSize * j); if (ti == tj) { + if (dataBuf->pTableMeta && dataBuf->pTableMeta->tableInfo.update != TD_ROW_DISCARD_UPDATE) { + memmove(pBlockData + dataBuf->rowSize * i, pBlockData + dataBuf->rowSize * j, dataBuf->rowSize); + } + ++j; continue; } @@ -841,6 +845,10 @@ int tscSortRemoveDataBlockDupRows(STableDataBlocks *dataBuf, SBlockKeyInfo *pBlk TSKEY tj = (pBlkKeyTuple + j)->skey; if (ti == tj) { + if (dataBuf->pTableMeta && dataBuf->pTableMeta->tableInfo.update != TD_ROW_DISCARD_UPDATE) { + memmove(pBlkKeyTuple + i, pBlkKeyTuple + j, sizeof(SBlockKeyTuple)); + } + ++j; continue; } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index ac91d845f778bcb5672edbde677b88e8c50e7d33..2b16ffc011f875ba716e60de207c26bfad3fcaec 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -4400,6 +4400,7 @@ STableMeta* createSuperTableMeta(STableMetaMsg* pChild) { pTableMeta->tableInfo.numOfTags = pChild->numOfTags; pTableMeta->tableInfo.numOfColumns = pChild->numOfColumns; pTableMeta->tableInfo.precision = pChild->precision; + pTableMeta->tableInfo.update = pChild->update; pTableMeta->id.tid = 0; pTableMeta->id.uid = pChild->suid; diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index fe553112cc969c9fdccc18b523cc4f65c2b0845f..dd4374761a6c90aa97b822ba8e814781b8ef0c7c 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -779,6 +779,7 @@ typedef struct STableMetaMsg { char tableFname[TSDB_TABLE_FNAME_LEN]; // table id uint8_t numOfTags; uint8_t precision; + uint8_t update; uint8_t tableType; int16_t numOfColumns; int16_t sversion; diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index e3c1af9bc01fddd8c7df78ace6c5c2b6ce13576c..e692f1d0b7fabc0f13ba8cf88c9c16e4c52e436e 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1793,6 +1793,7 @@ static int32_t mnodeDoGetSuperTableMeta(SMnodeMsg *pMsg, STableMetaMsg* pMeta) { pMeta->sversion = htons(pTable->sversion); pMeta->tversion = htons(pTable->tversion); pMeta->precision = pMsg->pDb->cfg.precision; + pMeta->update = pMsg->pDb->cfg.update; pMeta->numOfTags = (uint8_t)pTable->numOfTags; pMeta->numOfColumns = htons((int16_t)pTable->numOfColumns); pMeta->tableType = pTable->info.type; @@ -2510,6 +2511,7 @@ static int32_t mnodeDoGetChildTableMeta(SMnodeMsg *pMsg, STableMetaMsg *pMeta) { pMeta->uid = htobe64(pTable->uid); pMeta->tid = htonl(pTable->tid); pMeta->precision = pDb->cfg.precision; + pMeta->update = pDb->cfg.update; pMeta->tableType = pTable->info.type; tstrncpy(pMeta->tableFname, pTable->info.tableId, TSDB_TABLE_FNAME_LEN); diff --git a/src/query/inc/qTableMeta.h b/src/query/inc/qTableMeta.h index 6e9ba9c26f413e475d9f9ecba6f0705154a97bdd..fce8e23d1c0f2aa4b2bf4b35f2b99a1b5344658d 100644 --- a/src/query/inc/qTableMeta.h +++ b/src/query/inc/qTableMeta.h @@ -53,6 +53,7 @@ typedef struct SGroupbyExpr { typedef struct STableComInfo { uint8_t numOfTags; uint8_t precision; + uint8_t update; int16_t numOfColumns; int32_t rowSize; } STableComInfo; diff --git a/src/query/src/qTableMeta.c b/src/query/src/qTableMeta.c index f687b8aa1ffc530d0c4a71c553809dd3bfb83932..f786f4438c2915299fa320818d7a36811eef40dd 100644 --- a/src/query/src/qTableMeta.c +++ b/src/query/src/qTableMeta.c @@ -84,6 +84,7 @@ STableMeta* tscCreateTableMetaFromMsg(STableMetaMsg* pTableMetaMsg) { pTableMeta->tableInfo = (STableComInfo) { .numOfTags = pTableMetaMsg->numOfTags, .precision = pTableMetaMsg->precision, + .update = pTableMetaMsg->update, .numOfColumns = pTableMetaMsg->numOfColumns, };