Project

General

Profile

Actions

Bug #1607

closed

REST API calls /hosts/:id/puppetclasses fails with postgres

Added by Florent Castelli almost 12 years ago. Updated over 7 years ago.

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

Description

Calling /hosts/:id:puppetclasses fails with postgres.
The SQL request has an ORDER BY clause on a field not selected.

Suggested fix is to remove the default_scope in app/models/puppetclass.rb

Actions #1

Updated by Florent Castelli almost 12 years ago

Puppetclass Load (0.7ms) SELECT DISTINCT puppetclasses.id FROM "puppetclasses" INNER JOIN "host_classes" ON "puppetclasses"."id" = "host_classes"."puppetclass_id" INNER JOIN "hosts" ON "hosts"."id" = "host_classes"."host_id" WHERE (hosts.name = 'somehost') ORDER BY LOWER
PG::Error: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...osts.name = 'somehost') ORDER BY LOWER(pupp...
^
: SELECT DISTINCT puppetclasses.id FROM "puppetclasses" INNER JOIN "host_classes" ON "puppetclasses"."id" = "host_classes"."puppetclass_id" INNER JOIN "hosts" ON "hosts"."id" = "host_classes"."host_id" WHERE (hosts.name = 'somehost') ORDER BY LOWER

Actions #2

Updated by Ohad Levy almost 12 years ago

  • Status changed from New to Need more information

is this still releavant? is this one of the merged pull requests and I just missed this ticket?

Actions #4

Updated by Florent Castelli almost 12 years ago

  • Status changed from Need more information to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF