From bd64b9102db7bb07d429745c02e88a6aab0a86b7 Mon Sep 17 00:00:00 2001 From: slzhou Date: Wed, 1 Nov 2023 13:25:54 +0800 Subject: [PATCH] fix: fix address sanitizer error --- source/libs/parser/src/parInsertSql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 8c404e146c..7f6ce59fdc 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -238,7 +238,8 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, const char** pSql, E continue; } int16_t t = lastColIdx + 1; - int16_t index = insFindCol(&token, t, pBoundInfo->numOfCols, pSchema); + int16_t end = (boundColsType == BOUND_ALL_AND_TBNAME) ? (pBoundInfo->numOfCols - 1) : pBoundInfo->numOfCols; + int16_t index = insFindCol(&token, t, end, pSchema); if (index < 0 && t > 0) { index = insFindCol(&token, 0, t, pSchema); }