diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 43b849451972cd53740d3531fd4097909231acf4..e24f56ba57b0b01146c3d878901bf2f6d19a0a9a 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6900,7 +6900,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq const char* msg5 = "only primary timestamp/column in top/bottom function allowed as order column"; const char* msg6 = "only primary timestamp allowed as the second order column"; const char* msg7 = "only primary timestamp/column in groupby clause allowed as order column"; - const char* msg8 = "only column in groupby clause allowed as order column"; + //const char* msg8 = "only column in groupby clause allowed as order column"; const char* msg10 = "not support distinct mixed with order by"; const char* msg11 = "not support order with udf"; const char* msg12 = "order by tags not supported with diff/derivative/csum/mavg/stateCount/stateDuration"; @@ -7117,11 +7117,11 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq }else if (isTopBottomUniqueQuery(pQueryInfo)) { SArray *columnInfo = pQueryInfo->groupbyExpr.columnInfo; if (columnInfo != NULL && taosArrayGetSize(columnInfo) > 0) { - SColIndex* pColIndex = taosArrayGet(columnInfo, 0); + /*SColIndex* pColIndex = taosArrayGet(columnInfo, 0); if (pColIndex->colIndex != index.columnIndex) { return invalidOperationMsg(pMsgBuf, msg8); - } + }*/ } else { int32_t pos = tscExprTopBottomIndex(pQueryInfo); assert(pos > 0); diff --git a/tests/pytest/query/querySort.py b/tests/pytest/query/querySort.py index 8abec6cea1e405d519b197f6021cd4dec6b3ca50..919e2bb83a73d1720d9e70abe84a64b257fd3b87 100644 --- a/tests/pytest/query/querySort.py +++ b/tests/pytest/query/querySort.py @@ -130,7 +130,7 @@ class TDTestCase: tdSql.error("select top(tbcol1, 12) from st1 order by tbcol1,ts") tdSql.error("select top(tbcol1, 12) from st order by tbcol1,ts,tbcol2") tdSql.error("select top(tbcol1, 12) from st order by ts, tbcol1") - tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2") + #tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2") fun_list = ['avg','count','twa','sum','stddev','leastsquares','min', 'max','first','last','top','bottom','percentile','apercentile',