From 965c99dd96820697faf47980c750ab200d34d685 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Wed, 7 Sep 2022 17:55:22 +0800 Subject: [PATCH] fix(query): the name of fields maybe contain dot --- src/client/src/tscSQLParser.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index bb31b752a1..193676cd93 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -8481,7 +8481,15 @@ static bool check_expr_in_groupby_colum(SGroupbyExpr* pGroupbyExpr, SExprInfo* p return false; for (int32_t k = 0; k < pGroupbyExpr->numOfGroupCols ; ++k) { pIndex = taosArrayGet(pGroupbyExpr->columnInfo, k); - if (!strcmp(pIndex->name,&pExpr->base.colInfo.name[1])){ // notes:first char is dot, skip one char. + + // find last dot + char * name = strrchr(pExpr->base.colInfo.name, '.'); + if(name) + name += 1; + else + name = pExpr->base.colInfo.name; + + if (!strcmp(pIndex->name, name)){ return true; } } -- GitLab