minor replication changes - use a real hash merge, clarify master_read_weight, really...
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / SQLAHacks.pm
index d2f96bf..9fb3c24 100644 (file)
@@ -1,5 +1,5 @@
 package # Hide from PAUSE
-  DBIx::Class::SQLAHacks; # Would merge upstream, but nate doesn't reply :(
+  DBIx::Class::SQLAHacks;
 
 use base qw/SQL::Abstract::Limit/;
 use Carp::Clan qw/^DBIx::Class/;
@@ -17,7 +17,6 @@ sub new {
 }
 
 
-
 # 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.
@@ -125,7 +124,7 @@ sub select {
   local $self->{rownum_hack_count} = 1
     if (defined $rest[0] && $self->{limit_dialect} eq 'RowNum');
   @rest = (-1) unless defined $rest[0];
-  die "LIMIT 0 Does Not Compute" if $rest[0] == 0;
+  croak "LIMIT 0 Does Not Compute" if $rest[0] == 0;
     # and anyway, SQL::Abstract::Limit will cause a barf if we don't first
   my ($sql, @where_bind) = $self->SUPER::select(
     $table, $self->_recurse_fields($fields), $where, $order, @rest
@@ -190,7 +189,7 @@ sub _recurse_fields {
       if ($func eq 'distinct') {
         my $_fields = $fields->{$func};
         if (ref $_fields eq 'ARRAY' && @{$_fields} > 1) {
-          die "Unsupported syntax, please use " . 
+          croak "Unsupported syntax, please use " . 
               "{ group_by => [ qw/" . (join ' ', @$_fields) . "/ ] }" .
               " or " .
               "{ select => [ qw/" . (join ' ', @$_fields) . "/ ], distinct => 1 }";
@@ -213,7 +212,7 @@ sub _recurse_fields {
     return $self->_fold_sqlbind( $fields );
   }
   else {
-    Carp::croak($ref . qq{ unexpected in _recurse_fields()})
+    croak($ref . qq{ unexpected in _recurse_fields()})
   }
 }
 
@@ -333,8 +332,7 @@ sub _join_condition {
     for (keys %$cond) {
       my $v = $cond->{$_};
       if (ref $v) {
-        # XXX no throw_exception() in this package and croak() fails with strange results
-        Carp::croak(ref($v) . qq{ reference arguments are not supported in JOINS - try using \"..." instead'})
+        croak (ref($v) . qq{ reference arguments are not supported in JOINS - try using \"..." instead'})
             if ref($v) ne 'SCALAR';
         $j{$_} = $v;
       }
@@ -392,7 +390,9 @@ __END__
 
 =head1 NAME
 
-DBIx::Class::SQLAHacks - Things desired to be merged into SQL::Abstract
+DBIx::Class::SQLAHacks - This module is a subclass of SQL::Abstract::Limit
+and includes a number of DBIC-specific workarounds, not yet suitable for
+inclusion into SQLA proper.
 
 =head1 METHODS