Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case insensitive ordering of collections should be a total ordering #377

Open
joe-crawford opened this issue Dec 1, 2022 · 0 comments · May be fixed by #378
Open

Case insensitive ordering of collections should be a total ordering #377

joe-crawford opened this issue Dec 1, 2022 · 0 comments · May be fixed by #378
Assignees
Labels
bug Something isn't working
Milestone

Comments

@joe-crawford
Copy link
Contributor

Description

The collections returned by endpoints using the CatalogueItemSearch::applyHQLOrder sorting method may have ambiguous order when items have labels that are equal except in case and the sort is case insensitive (which is default).

In some cases a request with order=asc is not equal to the reverse order of the same request with order=desc.

Steps to reproduce

Create a DataModel and create DataClasses with identical labels except for case, e.g. class1, Class1, etc.

List the DataClasses with the GET api/dataModels/$dataModelId/dataClasses endpoint, sometimes the order is not the reverse of the same request with ?order=desc.

Expected behavior

Ordering should be ORDER BY lower(label) <order>, label <order>.

Environment

mdm-core latest develop

Additional context

Found while reviewing at PR #375.

@joe-crawford joe-crawford added the bug Something isn't working label Dec 1, 2022
@joe-crawford joe-crawford added this to the 5.3.0 milestone Dec 1, 2022
@joe-crawford joe-crawford self-assigned this Dec 1, 2022
@joe-crawford joe-crawford moved this to Backlog in MDM State Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

1 participant