diff --git a/source/libs/parser/src/parAstParser.c b/source/libs/parser/src/parAstParser.c index e6a905103a630044afd2226659dc1f2807b89642..f05987c3071c8d53fbec2a0bb49ffa5fe54f1513 100644 --- a/source/libs/parser/src/parAstParser.c +++ b/source/libs/parser/src/parAstParser.c @@ -110,7 +110,8 @@ static EDealRes collectMetaKeyFromFunction(SCollectMetaKeyFromExprCxt* pCxt, SFu if (fmIsBuiltinFunc(pFunc->functionName)) { return TSDB_CODE_SUCCESS; } - return reserveUdfInCache(pFunc->functionName, pCxt->pComCxt->pMetaCache); + pCxt->errCode = reserveUdfInCache(pFunc->functionName, pCxt->pComCxt->pMetaCache); + return TSDB_CODE_SUCCESS == pCxt->errCode ? DEAL_RES_CONTINUE : DEAL_RES_ERROR; } static int32_t collectMetaKeyFromRealTableImpl(SCollectMetaKeyCxt* pCxt, SRealTableNode* pRealTable, diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 8f17d500abd6984cfa896f860d64a50a29fea446..2cfc06b5755cf21fe39eda7ed5b6460c6b1993a4 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -1006,7 +1006,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint } SSchema* pTagSchema = &pSchema[pCxt->tags.boundColumns[i]]; - char* tmpTokenBuf = taosMemoryCalloc(1, sToken.n); //todo this can be optimize with parse column + char* tmpTokenBuf = taosMemoryCalloc(1, sToken.n); // todo this can be optimize with parse column code = checkAndTrimValue(&sToken, tmpTokenBuf, &pCxt->msg); if (code != TSDB_CODE_SUCCESS) { taosMemoryFree(tmpTokenBuf); @@ -1018,7 +1018,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint taosMemoryFree(tmpTokenBuf); goto end; } - if(isNullStr(&sToken)) { + if (isNullStr(&sToken)) { code = tTagNew(pTagVals, 1, true, &pTag); } else { code = parseJsontoTagData(sToken.z, pTagVals, &pTag, &pCxt->msg); @@ -1530,10 +1530,13 @@ typedef struct SInsertParseSyntaxCxt { } SInsertParseSyntaxCxt; static int32_t skipParentheses(SInsertParseSyntaxCxt* pCxt) { - SToken sToken; + SToken sToken; + int32_t expectRightParenthesis = 1; while (1) { NEXT_TOKEN(pCxt->pSql, sToken); - if (TK_NK_RP == sToken.type) { + if (TK_NK_LP == sToken.type) { + ++expectRightParenthesis; + } else if (TK_NK_RP == sToken.type && 0 == --expectRightParenthesis) { break; } if (0 == sToken.n) {