From 91d7050f8a93712886498047022c4e2a61b5b65c Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Wed, 27 Oct 2021 09:47:46 +0800 Subject: [PATCH] fix error that pLeft and pRight of sql expr can be null is it is a function --- src/client/src/tscSQLParser.c | 4 +++- src/kit/taosdemo/taosdemo.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index b0f691996d..adc2bb7f92 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -9341,7 +9341,9 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf } int32_t exprTreeFromSqlExpr(SSqlCmd* pCmd, tExprNode **pExpr, const tSqlExpr* pSqlExpr, SQueryInfo* pQueryInfo, SArray* pCols, uint64_t *uid) { - if (pSqlExpr->pLeft == NULL && pSqlExpr->pRight == NULL) { + if (pSqlExpr->type != SQL_NODE_EXPR && pSqlExpr->type != SQL_NODE_SQLFUNCTION) { + assert(pSqlExpr->pLeft == NULL && pSqlExpr->pRight == NULL && + ( pSqlExpr->Expr.paramList == NULL || taosArrayGetSize(pSqlExpr->Expr.paramList) == 0)); if (pSqlExpr->type == SQL_NODE_VALUE) { int32_t ret = TSDB_CODE_SUCCESS; *pExpr = calloc(1, sizeof(tExprNode)); diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 761593f676..6b4cc4c886 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -511,7 +511,7 @@ typedef struct SThreadInfo_S { int threadID; char db_name[TSDB_DB_NAME_LEN]; uint32_t time_precision; - char filePath[TSDB_FILENAME_LEN]; + char filePath[384]; FILE *fp; char tb_prefix[TSDB_TABLE_NAME_LEN]; uint64_t start_table_from; -- GitLab