The hack is no longer necessary with a recent sqla
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / SQLAHacks.pm
index 3a0d1f6..429be4f 100644 (file)
@@ -47,52 +47,6 @@ sub new {
   $self;
 }
 
-# Some databases (sqlite) do not handle multiple parenthesis
-# around in/between arguments. A tentative x IN ( (1, 2 ,3) )
-# is interpreted as x IN 1 or something similar.
-#
-# Since we currently do not have access to the SQLA AST, resort
-# to barbaric mutilation of any SQL supplied in literal form
-sub _strip_outer_paren {
-  my ($self, $arg) = @_;
-
-  return $self->_SWITCH_refkind ($arg, {
-    ARRAYREFREF => sub {
-      $$arg->[0] = __strip_outer_paren ($$arg->[0]);
-      return $arg;
-    },
-    SCALARREF => sub {
-      return \__strip_outer_paren( $$arg );
-    },
-    FALLBACK => sub {
-      return $arg
-    },
-  });
-}
-
-sub __strip_outer_paren {
-  my $sql = shift;
-
-  if ($sql and not ref $sql) {
-    while ($sql =~ /^ \s* \( (.*) \) \s* $/x ) {
-      $sql = $1;
-    }
-  }
-
-  return $sql;
-}
-
-sub _where_field_IN {
-  my ($self, $lhs, $op, $rhs) = @_;
-  $rhs = $self->_strip_outer_paren ($rhs);
-  return $self->SUPER::_where_field_IN ($lhs, $op, $rhs);
-}
-
-sub _where_field_BETWEEN {
-  my ($self, $lhs, $op, $rhs) = @_;
-  $rhs = $self->_strip_outer_paren ($rhs);
-  return $self->SUPER::_where_field_BETWEEN ($lhs, $op, $rhs);
-}
 
 # Slow but ANSI standard Limit/Offset support. DB2 uses this
 sub _RowNumberOver {
@@ -517,7 +471,7 @@ sub _recurse_from {
       $join_type =~ s/^\s+ | \s+$//xg;
     }
 
-    $join_type = $self->_default_jointype if not defined $join_type;
+    $join_type = $self->{_default_jointype} if not defined $join_type;
 
     my $join_clause = sprintf ('%s JOIN ',
       $join_type ?  ' ' . uc($join_type) : ''
@@ -534,8 +488,6 @@ sub _recurse_from {
   return join('', @sqlf);
 }
 
-sub _default_jointype {};
-
 sub _fold_sqlbind {
   my ($self, $sqlbind) = @_;