[Dbix-class] Incorrect SQL being generated after DBIC library
upgrade
Michael Higgins
linux at evolone.org
Thu Mar 19 17:28:47 GMT 2009
On Thu, 19 Mar 2009 15:04:05 +0000
Anthony Gladdish <a.j.gladdish at newcastle.ac.uk> wrote:
> Hi,
>
> Upgrading from:
>
> DBIC v0.08010
> SQL:Abstract v1.24
>
> to:
>
> DBIC v0.08012
> SQL:Abstract v1.5
Big changes.
[...]
> I'm expecting:
>
> WHERE ( ( ( module_access.expires > ? OR scheme_access.expires > ? )
> AND me.person = ? ) ): '2009-03-19T14:38:06', '2009-03-19T14:38:06',
> '2'
>
> ... notice the "AND". This expected SQL was getting generated prior
> to upgrading my libraries.
>
> >From the DBIC 0.08012 cookbook "Complex WHERE clauses"
> >documentation, it looks like my original search() should work?!
>
> Placing {} braces around the "-or => []" bit, or doing "-and => {}"
> instead, appears to fix this, but I'm not sure if this is correct or
> not?
[ Hopefully, others will correct me if I'm off-base. ]
I think this is a change that is in a different module. A big chunk of SQL:Abstract is overridden in DBIx-Class-Storage-DBI.
package DBIx::Class::Storage::DBI;
[ ... ]
package DBIC::SQL::Abstract; # Would merge upstream, but nate doesn't reply :(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
use base qw/SQL::Abstract::Limit/;
Changes happen in there, I think. You have discovered the new syntax. Glad it works for you. '-)
Cheers,
--
|\ /| | | ~ ~
| \/ | |---| `|` ?
| |ichael | |iggins \^ /
michael.higgins[at]evolone[dot]org
More information about the DBIx-Class
mailing list