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
Actions