From: Peter Rabbitson Date: Thu, 23 Dec 2010 19:23:45 +0000 (+0100) Subject: Fix no-quoting assumptions in 'having' docs (RT#64129) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47a435d239f7a6d8b5770698e6ae785c2f56b66a;p=dbsrgits%2FDBIx-Class-Historic.git Fix no-quoting assumptions in 'having' docs (RT#64129) --- diff --git a/Changes b/Changes index ea0978d..584ceb8 100644 --- a/Changes +++ b/Changes @@ -40,6 +40,7 @@ Revision history for DBIx::Class - Stop stripping newlines from SQL statements in the limit emulators as it is possible that custom sql with comments was provided - Add forgotten attributes to Admin.pm + - Fix incorrect 'having' attribute documentation (RT#64129) * Misc - Add extra option groups to DBIC::Optional::Depencencies, to aid diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 427657a..f060d45 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -3994,7 +3994,11 @@ HAVING is a select statement attribute that is applied between GROUP BY and ORDER BY. It is applied to the after the grouping calculations have been done. - having => { 'count(employee)' => { '>=', 100 } } + having => { 'count_employee' => { '>=', 100 } } + +or with an in-place function in which case literal SQL is required: + + having => \[ 'count(employee) >= ?', [ count => 100 ] ] =head2 distinct