Project

General

Profile

Actions

Bug #5566

closed

Fact Values Query Produces Error

Added by Paul Calabro almost 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Search
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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.


Related issues 2 (0 open2 closed)

Has duplicate Foreman - Bug #5906: Can't search facts give error / facts search for a particular word does not workDuplicate05/23/2014Actions
Has duplicate Foreman - Bug #5670: Invalid sql when searching for two wordsDuplicate05/12/2014Actions
Actions #1

Updated by Dominic Cleal almost 10 years ago

  • Category set to Search
Actions #2

Updated by Dominic Cleal almost 10 years ago

  • Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1093151
Actions #3

Updated by Dominic Cleal almost 10 years ago

  • Has duplicate Bug #5906: Can't search facts give error / facts search for a particular word does not work added
Actions #4

Updated by Joseph Magen almost 10 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Joseph Magen
  • Target version set to 1.8.2
Actions #5

Updated by Paul Calabro almost 10 years ago

This fixed my issue! Thanks guys! :)

Actions #6

Updated by Anonymous almost 10 years ago

  • Target version changed from 1.8.2 to 1.8.1
Actions #7

Updated by Dominic Cleal almost 10 years ago

  • Has duplicate Bug #5670: Invalid sql when searching for two words added
Actions #8

Updated by Dominic Cleal almost 10 years ago

  • translation missing: en.field_release set to 18
Actions #9

Updated by Joseph Magen almost 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF