[Dbix-class] Find with literal SQL and bind not satisfying constraint

Peter Rabbitson rabbit+dbic at rabbit.us
Wed Apr 29 21:10:49 GMT 2015


On 04/29/2015 05:44 PM, Christian Lackas wrote:
> Hi Everybody,
>
> we used to do something like this:
>
>      my $proj = $projects->find( { projectpath => \'= ? COLLATE utf8_bin' },
>          { key => 'ProjectPath', bind => [ $p ] } );
>
> to find a project by its unique path in a case-sensitive way.
> Unfortunately, after an upgrade of DBIx::Class (from 0.08204 to
> 0.082820) we now get an error message:

Crap. This is a regression, I will have to investigate to figure out how 
to cleanly fix it. In the meantime the following will work:
{ projectpath => { '=' => \['? COLLATE utf8_bin', $p ] } }

Avoid using the bind attribute - it doesn't do what you think it does 
(another doc clarification that hasn't been written yet, sigh...)




More information about the DBIx-Class mailing list