From 98e4064bd5e7f1f4994cf386760a05046b9cbca7 Mon Sep 17 00:00:00 2001 From: wangjiaming0909 Date: Fri, 7 Mar 2025 18:59:11 +0800 Subject: [PATCH] remove assert --- source/common/src/tdataformat.c | 1 - source/dnode/mnode/impl/src/mndStream.c | 1 - source/libs/decimal/src/decimal.c | 3 --- 3 files changed, 5 deletions(-) diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index 528019c248..e481e10e0d 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -4770,7 +4770,6 @@ int32_t tDecompressDataToBuffer(void *input, SCompressInfo *info, SBuffer *outpu // handle all types, including var data void valueSetDatum(SValue *pVal, int8_t type, void *pDatum, uint32_t len) { - assert(type == pVal->type); if (IS_VAR_DATA_TYPE(type) || type == TSDB_DATA_TYPE_DECIMAL) { pVal->pData = pDatum; pVal->nData = len; diff --git a/source/dnode/mnode/impl/src/mndStream.c b/source/dnode/mnode/impl/src/mndStream.c index 08f16b7e1e..5634e4ea15 100644 --- a/source/dnode/mnode/impl/src/mndStream.c +++ b/source/dnode/mnode/impl/src/mndStream.c @@ -635,7 +635,6 @@ static int32_t mndCreateStbForStream(SMnode *pMnode, STrans *pTrans, const SStre uint8_t prec = 0, scale = 0; extractDecimalTypeInfoFromBytes(&pField->bytes, &prec, &scale); pField->typeMod = decimalCalcTypeMod(prec, scale); - ASSERT(pField->flags & COL_HAS_TYPE_MOD);// TODO wjm } } diff --git a/source/libs/decimal/src/decimal.c b/source/libs/decimal/src/decimal.c index 136b8e4855..381686814f 100644 --- a/source/libs/decimal/src/decimal.c +++ b/source/libs/decimal/src/decimal.c @@ -972,7 +972,6 @@ static int32_t decimalDivide(Decimal* pX, const SDataType* pXT, const Decimal* p } int8_t deltaScale = pOT->scale + pYT->scale - pXT->scale; - assert(deltaScale >= 0); Decimal xTmp = *pX; decimal128Abs(&xTmp); // TODO wjm test decimal64 / decimal64 @@ -1264,7 +1263,6 @@ static int64_t int64FromDecimal64(const DecimalType* pDec, uint8_t prec, uint8_t Decimal64 rounded = *(Decimal64*)pDec; bool overflow = false; decimal64RoundWithPositiveScale(&rounded, prec, scale, prec, 0, ROUND_TYPE_HALF_ROUND_UP, &overflow); - assert(!overflow); // TODO wjm remove this assert if (overflow) return 0; return DECIMAL64_GET_VALUE(&rounded); @@ -1274,7 +1272,6 @@ static uint64_t uint64FromDecimal64(const DecimalType* pDec, uint8_t prec, uint8 Decimal64 rounded = *(Decimal64*)pDec; bool overflow = false; decimal64RoundWithPositiveScale(&rounded, prec, scale, prec, 0, ROUND_TYPE_HALF_ROUND_UP, &overflow); - assert(!overflow); // TODO wjm remove this assert if (overflow) return 0; return DECIMAL64_GET_VALUE(&rounded);