Hide Forgot
Description of problem: Version-Release number of selected component (if applicable): katello-0.1.92-1.git.0.657d7d5.fc14.noarch How reproducible: Steps to Reproduce: 1. Go to custom provider page 2. In filter box, type "blah", press Enter 3. Actual results: Error: PGError: ERROR: column reference "name" is ambiguous LINE 1: ...ECT DISTINCT ON ("providers".id) "providers".id, name AS al... ^ : SELECT * FROM (SELECT DISTINCT ON ("providers".id) "providers".id, name AS alias_0 FROM "providers" LEFT OUTER JOIN "products" ON "products"."provider_id" = "providers"."id" WHERE "providers"."organization_id" = 1 AND "providers"."provider_type" = 'Custom' AND (("providers"."name" ILIKE '%blah%' OR "providers"."description" ILIKE '%blah%' OR "products"."name" ILIKE '%blah%' OR "products"."description" ILIKE '%blah%'))) AS id_list ORDER BY id_list.alias_0 LIMIT 25 Expected results: results are filtered, no results shown (unless you have a provider named blah). Additional info:
This appears to be an issue in the scoped_search gem generating invalid SQL. We had a similar issue with auto-complete which was addressed in scoped_search 2.3.4; however, looks like a similar issues exists on a search queries also. Another example that will generate this type of error is: provider.name = "spacewalk" generates the following error: SQLite3::SQLException: ambiguous column name: name: SELECT DISTINCT "providers".id FROM "providers" LEFT OUTER JOIN "products" ON "products"."provider_id" = "providers"."id" WHERE "providers"."organization_id" = 1 AND "providers"."provider_type" = 'Custom' AND (("products"."name" = 'spacewalk')) ORDER BY name LIMIT 25
Problem seemed to be the order statement not the scoped_search. fixed by commit #08385944d35e24d7f29dba4675cc5d7fbf606904
Unfortunately, I still see the same problem with the change committed. Example scenario: 1. create a provider : spacewalk 2. create a product under that provider : spacewalk_product 3. perform a provider search using : product.name = spacewalk_product generates the following exception: SQLite3::SQLException: ambiguous column name: name: SELECT DISTINCT "products".name FROM "products" INNER JOIN "providers" ON "providers"."id" = "products"."provider_id" WHERE "providers"."organization_id" = 1 AND (name LIKE 'spacewalk_product%') LIMIT 20 rather than "(name LIKE 'spacewalk_product%')", the query should contain something like "('products'.name LIKE 'spacewalk_product%')"
Brad's repro scenario still fails. The original "plain" search term now works though. katello-0.1.95-1.git.56.344ea38.el6.x86_64
verified that the issues raised in the initial description and my repro scenario are no longer observable with scoped_search 2.3.6... that version of scoped_search gem has been pushed in to the git repos and should be available in an upcoming build.
Verified, katello-0.1.116-1.git.0.ed4d8a9.el6.x86_64
getting rid of 6.0.0 version since that doesn't exist
Thank goodness i have found someone else experiencing the same problem. https://www.mybkexperience.review/