Ensure the custom rel cond resolver does not trigger forgotten compat shim
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / SQLMaker / OracleJoins.pm
index 3401a93..44f4b08 100644 (file)
@@ -1,5 +1,4 @@
-package # Hide from PAUSE
-  DBIx::Class::SQLMaker::OracleJoins;
+package DBIx::Class::SQLMaker::OracleJoins;
 
 use warnings;
 use strict;
@@ -81,10 +80,24 @@ sub _recurse_oracle_joins {
         && $jt !~ /inner/i;
     }
 
+    # FIXME - the code below *UTTERLY* doesn't work with custom conds... sigh
+    # for the time being do not do any processing with the likes of _collapse_cond
+    # instead only unroll the -and hack if present
+    $on = $on->{-and}[0] if (
+      ref $on eq 'HASH'
+        and
+      keys %$on == 1
+        and
+      ref $on->{-and} eq 'ARRAY'
+        and
+      @{$on->{-and}} == 1
+    );
+
+    # sadly SQLA treats where($scalar) as literal, so we need to jump some hoops
     push @where, map { \sprintf ('%s%s = %s%s',
-      $self->_quote($_),
+      ref $_ ? $self->_recurse_where($_) : $self->_quote($_),
       $left_join,
-      $self->_quote($on->{$_}),
+      ref $on->{$_} ? $self->_recurse_where($on->{$_}) : $self->_quote($on->{$_}),
       $right_join,
     )} keys %$on;
   }
@@ -102,9 +115,8 @@ DBIx::Class::SQLMaker::OracleJoins - Pre-ANSI Joins-via-Where-Clause Syntax
 
 =head1 PURPOSE
 
-This module was originally written to support Oracle < 9i where ANSI joins
-weren't supported at all, but became the module for Oracle >= 8 because
-Oracle's optimising of ANSI joins is horrible.
+This module is used with Oracle < 9.0 due to lack of support for standard
+ANSI join syntax.
 
 =head1 SYNOPSIS