On Tue, Jun 11, 2013 at 04:43:04PM +0400, Dmitry Belyavsky wrote:
> Greetings!
> 
> After upgrading the DBIx::Class package from 8.0127 to 8.0196 the problem
> occurs in using
> select attribute of a ResultSet with DISTINCT qualifier.
> 
> I used the syntax
> 
>   my $rs_2 = $rs->search({},
>       {
>       select => ['DISTINCT searchable_id', "dense_rank() OVER (ORDER BY
> $order_by) AS pos" ],
>       as     => ['searchable_id', 'pos'],
>       }
>       );

This worked before by accident: you are asking DBIC to look for a column 
named (literally) q{DISTINCT searchable_id}. It only worked because you 
didn't ask DBIC to quote your identifiers. In newer versions of DBIC 
various arguments are interrogated more closely, and everything 
understandably fails.

All you want to do is say \'DISTINCT searchable_id'

Cheers


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk

Reply via email to