diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index a972473cf3395f07ec508b6307e1d5204253be3f..f2d5997d3a511cd46bdf2269e1ce31bb66372ae1 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 {