Bug #1607
closed
REST API calls /hosts/:id/puppetclasses fails with postgres
Added by Florent Castelli over 12 years ago.
Updated over 8 years ago.
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
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
- 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?
- Status changed from Need more information to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF