Merge pull request #6974 from taosdata/fix/TD-5459

[TD-5459]<fix>: fix sql parse core error
This commit is contained in:
Haojun Liao 2021-07-22 18:24:55 +08:00 committed by GitHub
commit f18aa2d423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -1904,7 +1904,6 @@ int tsInsertInitialCheck(SSqlObj *pSql) {
int tsParseSql(SSqlObj *pSql, bool initial) { int tsParseSql(SSqlObj *pSql, bool initial) {
int32_t ret = TSDB_CODE_SUCCESS; int32_t ret = TSDB_CODE_SUCCESS;
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
if (!initial) { if (!initial) {
tscDebug("0x%"PRIx64" resume to parse sql: %s", pSql->self, pCmd->insertParam.sql); tscDebug("0x%"PRIx64" resume to parse sql: %s", pSql->self, pCmd->insertParam.sql);
} }

View File

@ -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) { 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); size_t t = taosArrayGetSize(pUdfInfo);
for(int32_t i = 0; i < t; ++i) { for(int32_t i = 0; i < t; ++i) {
SUdfInfo* pUdf = taosArrayGet(pUdfInfo, i); SUdfInfo* pUdf = taosArrayGet(pUdfInfo, i);

View File

@ -254,7 +254,7 @@ typedef struct tSqlExpr {
struct SArray *paramList; // function parameters list struct SArray *paramList; // function parameters list
} Expr; } Expr;
uint32_t functionId; // function id, todo remove it int32_t functionId; // function id, todo remove it
SStrToken columnName; // table column info SStrToken columnName; // table column info
tVariant value; // the use input value tVariant value; // the use input value
SStrToken exprToken; // original sql expr string SStrToken exprToken; // original sql expr string