Bug #5566
closedFact Values Query Produces Error
Description
When issuing the following query: fact = network_address <any string goes here>
I receive the following trace:
ActiveRecord::StatementInvalid
PGError: ERROR: syntax error at or near "OR" LINE 1: ...ub01%' OR "fact_names"."name" ILIKE '%dub01%' OR OR "hostgr... ^ : SELECT DISTINCT "fact_values".id, "fact_values"."value" AS alias_0 FROM "fact_values" LEFT OUTER JOIN "fact_names" ON "fact_names"."id" = "fact_values"."fact_name_id" LEFT OUTER JOIN "hosts" ON "hosts"."id" = "fact_values"."host_id" AND "hosts"."type" IN ('Host::Managed') LEFT OUTER JOIN "hostgroups" ON "hostgroups"."id" = "hosts"."hostgroup_id" LEFT OUTER JOIN "hosts" "hosts_fact_values" ON "hosts_fact_values"."id" = "fact_values"."host_id" AND "hosts_fact_values"."type" IN ('Host::Managed') INNER JOIN "fact_names" fact_names_364687 ON (fact_names_364687.id = fact_values.fact_name_id) WHERE (fact_names.name <> '_timestamp') AND ((fact_names_364687."name" = '') AND (("fact_names"."name" = 'network_address') AND ("fact_values"."value" ILIKE '%dub01%' OR "fact_values"."value" ILIKE '%dub01%' OR "fact_names"."name" ILIKE '%dub01%' OR OR "hostgroups"."name" ILIKE '%dub01%' OR "fact_names"."short_name" ILIKE '%dub01%'))) ORDER BY "fact_values"."value" ASC NULLS FIRST LIMIT 150 OFFSET 0
app/views/fact_values/index.html.erb:15:in `_app_views_fact_values_index_html_erb___1537369141514873972_74205940'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
If I change the query to: fact = network_address and host = <FQDN goes here>
it works fine.
Updated by Dominic Cleal over 10 years ago
- Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1093151
Updated by Dominic Cleal over 10 years ago
- Has duplicate Bug #5906: Can't search facts give error / facts search for a particular word does not work added
Updated by Joseph Magen over 10 years ago
- Status changed from New to Ready For Testing
- Assignee set to Joseph Magen
- Target version set to 1.8.2
Updated by Anonymous over 10 years ago
- Target version changed from 1.8.2 to 1.8.1
Updated by Dominic Cleal over 10 years ago
- Has duplicate Bug #5670: Invalid sql when searching for two words added
Updated by Dominic Cleal over 10 years ago
- Translation missing: en.field_release set to 18
Updated by Joseph Magen over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset b7ae68362481b2b7227fd39cf2be80bf3fc3af9f.