From 51650434a2fe4f18e5f690b894919eae01656a26 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 27 Dec 2022 17:30:39 +0800 Subject: [PATCH] fix: move check tbname after compare column name --- src/client/src/tscSQLParser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index a972473cf3..f2d5997d3a 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4013,16 +4013,16 @@ int32_t doGetColumnIndexByName(SStrToken* pToken, SQueryInfo* pQueryInfo, SColum } } + // check tbname + if(pIndex->columnIndex == COLUMN_INDEX_INITIAL_VAL && isTablenameToken(pToken)) { + pIndex->columnIndex = TSDB_TBNAME_COLUMN_INDEX; + } + if (pIndex->columnIndex == COLUMN_INDEX_INITIAL_VAL) { return invalidOperationMsg(msg, msg1); } } - // check - if(pIndex->columnIndex == COLUMN_INDEX_INITIAL_VAL && isTablenameToken(pToken)) { - pIndex->columnIndex = TSDB_TBNAME_COLUMN_INDEX; - } - if (COLUMN_INDEX_VALID(*pIndex)) { return TSDB_CODE_SUCCESS; } else { -- GitLab