diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 6df724881e145a5698a73b228761dc68187465dd..f5457f637c706343c266b4040e5067ac5df39818 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7790,7 +7790,7 @@ int32_t tscGetExprFilters(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pSelect size_t n = tscNumOfExprs(pQueryInfo); *pExpr = tscExprGet(pQueryInfo, (int32_t)n - 1); - SInternalField* pField = taosArrayGet(pQueryInfo->fieldsInfo.internalField, n - 1); + SInternalField* pField = taosArrayGetLast(pQueryInfo->fieldsInfo.internalField); pField->visible = false; return TSDB_CODE_SUCCESS;