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

[24.0] Published histories sort by username produces an error #17737

Closed
ahmedhamidawan opened this issue Mar 14, 2024 · 1 comment
Closed

[24.0] Published histories sort by username produces an error #17737

ahmedhamidawan opened this issue Mar 14, 2024 · 1 comment

Comments

@ahmedhamidawan
Copy link
Member

published_hist_sort_username_bug

To Reproduce
Steps to reproduce the behavior:

  1. Go to Histories Grid
  2. Click on Public Histories
  3. Click on Username col header
  4. See error in alert

Expected behavior
We should sort published histories by username

@jdavcs
Copy link
Member

jdavcs commented Mar 15, 2024

This is caused by this:

ProgrammingError
(psycopg2.errors.InvalidColumnReference) for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 5: ...rged = false AND history.deleted = false ORDER BY galaxy_use...
                                                           ^
[SQL: SELECT DISTINCT history.update_time, (SELECT max(history_audit.update_time) AS max_1 
FROM history_audit 
WHERE history_audit.history_id = history.id) AS anon_1, history.id, history.create_time, history.user_id, history.name, history.hid_counter, history.deleted, history.purged, history.importing, history.genome_build, history.importable, history.slug, history.published, history.preferred_object_store_id, history.archived, history.archive_export_id 
FROM history LEFT OUTER JOIN galaxy_user ON galaxy_user.id = history.user_id 
WHERE history.published = true AND history.purged = false AND history.deleted = false ORDER BY galaxy_user.username DESC 
 LIMIT %(param_1)s OFFSET %(param_2)s]

The error here is on the back end: with DISTINCT, any column appearing in the ORDER BY clause must be included in the SELECT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants