Actions
Bug #21082
closedCombination of owner search with generic search term ends up with sql issues
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Reproducer:
1. search for owner.id = current_user AND ITSBROKEN
2. exception is given:
PG::DuplicateAlias: ERROR: table name "foreman_tasks_locks_owner" specified more than once : SELECT DISTINCT "foreman_tasks_tasks".* FROM "foreman_tasks_tasks" INNER JOIN "foreman_tasks_locks" ON "foreman_tasks_locks"."task_id" = "foreman_tasks_tasks"."id" INNER JOIN foreman_tasks_locks AS foreman_tasks_locks_owner ON (foreman_tasks_locks_owner.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_owner.resource_type = 'User' AND foreman_tasks_locks_owner.name = 'task_owner') INNER JOIN foreman_tasks_locks AS foreman_tasks_locks_owner ON (foreman_tasks_locks_owner.task_id = foreman_tasks_tasks.id AND foreman_tasks_locks_owner.resource_type = 'User' AND foreman_tasks_locks_owner.name = 'task_owner') INNER JOIN users as users ON (users.id = foreman_tasks_locks_owner.resource_id) WHERE (((foreman_tasks_locks_owner.resource_id = 3) AND ("foreman_tasks_tasks"."id" ILIKE '%ITISBROKEN%' OR "foreman_tasks_tasks"."label" ILIKE '%ITISBROKEN%' OR "foreman_tasks_tasks"."state" ILIKE '%ITISBROKEN%' OR "foreman_tasks_tasks"."result" ILIKE '%ITISBROKEN%' OR "foreman_tasks_tasks"."parent_task_id" ILIKE '%ITISBROKEN%' OR foreman_tasks_locks."resource_type" ILIKE 'ITISBROKEN' OR users.login ILIKE 'ITISBROKEN' or users.firstname ILIKE 'ITISBROKEN' OR users.login ILIKE 'ITISBROKEN' or users.firstname ILIKE 'ITISBROKEN' ))) ORDER BY "foreman_tasks_tasks"."started_at" DESC NULLS LAST LIMIT 20 OFFSET 0
Expected:
No exception
Updated by The Foreman Bot about 7 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ivan Necas
- Pull request https://github.com/theforeman/foreman-tasks/pull/287 added
Updated by Ivan Necas about 7 years ago
- Related to Refactor #21083: Use explicit relation for task -> user association added
Updated by Ivan Necas about 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 35c6d6aa1ec4c61cd4498705df5df76b3c952427.
Updated by Ivan Necas about 7 years ago
- Subject changed from Combination of owner search with generic search term ends up with sql issues to Combination of owner search with generic search term ends up with sql issues
- Translation missing: en.field_release set to 316
Updated by Lukáš Hellebrandt over 6 years ago
VERIFIED with Katello 3.5 foreman-tasks 0.10.9.
Used steps from the OP. Without roles, the list is empty and searching in it leads to empty list once again, without any error.
Actions