From aa6c9bc0a7823155546a4e3e61746b6a22a279f4 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 21 Sep 2024 08:32:13 +0800 Subject: [PATCH] fix: column length check for stmt insert --- source/common/src/tdataformat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/common/src/tdataformat.c b/source/common/src/tdataformat.c index cc4a0b759d..0ef254f7b7 100644 --- a/source/common/src/tdataformat.c +++ b/source/common/src/tdataformat.c @@ -115,7 +115,7 @@ static FORCE_INLINE int32_t tRowBuildScanAddNull(SRowBuildScanInfo *sinfo, const return 0; } -static FORCE_INLINE int32_t tRowBuildScanAddValue(SRowBuildScanInfo *sinfo, SColVal *colVal, const STColumn *pTColumn) { +static FORCE_INLINE void tRowBuildScanAddValue(SRowBuildScanInfo *sinfo, SColVal *colVal, const STColumn *pTColumn) { bool isPK = ((pTColumn->flags & COL_IS_KEY) != 0); if (isPK) { @@ -140,7 +140,6 @@ static FORCE_INLINE int32_t tRowBuildScanAddValue(SRowBuildScanInfo *sinfo, SCol + tDataTypes[colVal->value.type].bytes; // value } sinfo->numOfValue++; - return 0; } static int32_t tRowBuildScan(SArray *colVals, const STSchema *schema, SRowBuildScanInfo *sinfo) { @@ -178,7 +177,7 @@ static int32_t tRowBuildScan(SArray *colVals, const STSchema *schema, SRowBuildS } if (COL_VAL_IS_VALUE(&colValArray[colValIndex])) { - if ((code = tRowBuildScanAddValue(sinfo, &colValArray[colValIndex], schema->columns + i))) goto _exit; + tRowBuildScanAddValue(sinfo, &colValArray[colValIndex], schema->columns + i); } else if (COL_VAL_IS_NULL(&colValArray[colValIndex])) { if ((code = tRowBuildScanAddNull(sinfo, schema->columns + i))) goto _exit; } else if (COL_VAL_IS_NONE(&colValArray[colValIndex])) {