shwstppr commented on a change in pull request #5320:
URL: https://github.com/apache/cloudstack/pull/5320#discussion_r690278012
##########
File path: framework/db/src/main/java/com/cloud/utils/db/Filter.java
##########
@@ -77,7 +77,9 @@ public void addOrderBy(Class<?> clazz, String field, boolean
ascending) {
Column column = f.getAnnotation(Column.class);
String name = column != null ? column.name() : field;
-
+ if (!name.equals("id")) {
+ name = String.format("%s, id", name);
Review comment:
@rhtyd as mentioned in the PR desc, it is sorting issue when entries in
table have same value for the column (for which order by is called). In case of
list* APIs where resources have `sort_key` in their corresponding tables.
Since by default value for `sort_key` is `0`, weirdly sorted results are
returned when `LIMIT` offset is used. Change will add `id` as secondary sort
criteria.
Only issue I see is the case when table doesn't have id column. Don't think
that is the case with tables in ACS.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]