Anthony Hinsinger wrote:

Hi Anthony,

> I've the same problem, and I think the only solution to resolve it is
> to modify the code. DBIC (i think) assumes that  join conditions are
> all based on the '=' operator. For DBMS, join condition is an
> expression resulting in a value of type boolean.

I'm not quite sure which code you mean (my Perl code, my SQL code or 
DBIC). I hacked on the latter and now my task can be solved (though it 
is still very ugly).

Matt, make me happy and apply the attached patch to DBIC. :-)
-- 
Bernhard Graf
--- DBIx/Class/Storage/DBI.pm	(revision 2947)
+++ DBIx/Class/Storage/DBI.pm	(working copy)
@@ -232,7 +232,13 @@
   if (ref $cond eq 'HASH') {
     my %j;
     for (keys %$cond) {
-      my $x = '= '.$self->_quote($cond->{$_}); $j{$_} = \$x;
+      my $v = $cond->{$_};
+      if (ref $v) {
+        $j{$_} = $v;
+      }
+      else {
+        my $x = '= '.$self->_quote($v); $j{$_} = \$x;
+      }
     };
     return $self->_recurse_where(\%j);
   } elsif (ref $cond eq 'ARRAY') {
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to