From 87ca06dad5c25f35ed9545beea0024d3c03ef8db Mon Sep 17 00:00:00 2001 From: markswang <792637585@qq.com> Date: Thu, 22 Jul 2021 16:41:54 +0800 Subject: [PATCH] [TD-5459]: fix sql parse core error --- src/client/src/tscParseInsert.c | 2 +- src/client/src/tscSQLParser.c | 5 +++++ src/query/inc/qSqlparser.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index d26cbebc34..bc6f44397b 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -1904,7 +1904,7 @@ int tsInsertInitialCheck(SSqlObj *pSql) { int tsParseSql(SSqlObj *pSql, bool initial) { int32_t ret = TSDB_CODE_SUCCESS; SSqlCmd* pCmd = &pSql->cmd; - +1905 if (!initial) { tscDebug("0x%"PRIx64" resume to parse sql: %s", pSql->self, pCmd->insertParam.sql); } diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index adea1cc453..c0627f4c31 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -2023,6 +2023,11 @@ static int32_t checkForUdf(SSqlObj* pSql, SQueryInfo* pQueryInfo, SArray* pSelec */ static SUdfInfo* isValidUdf(SArray* pUdfInfo, const char* name, int32_t len) { + if(pUdfInfo == NULL){ + tscError("udfinfo is null"); + return NULL; + } + size_t t = taosArrayGetSize(pUdfInfo); for(int32_t i = 0; i < t; ++i) { SUdfInfo* pUdf = taosArrayGet(pUdfInfo, i); diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index f2ab2182a1..531ff06565 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -254,7 +254,7 @@ typedef struct tSqlExpr { struct SArray *paramList; // function parameters list } Expr; - uint32_t functionId; // function id, todo remove it + int32_t functionId; // function id, todo remove it SStrToken columnName; // table column info tVariant value; // the use input value SStrToken exprToken; // original sql expr string -- GitLab