Merge 'trunk' into 'mssql_top_fixes'
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Storage / DBI / Cursor.pm
index e46c1b6..bd2a20a 100644 (file)
@@ -36,8 +36,8 @@ Returns a new L<DBIx::Class::Storage::DBI::Cursor> object.
 
 sub new {
   my ($class, $storage, $args, $attrs) = @_;
-  #use Data::Dumper; warn Dumper(@_);
   $class = ref $class if ref $class;
+
   my $new = {
     storage => $storage,
     args => $args,
@@ -124,7 +124,10 @@ sub _dbh_all {
 
 sub all {
   my ($self) = @_;
-  return $self->SUPER::all if $self->{attrs}{rows};
+  if ($self->{attrs}{software_limit}
+        && ($self->{attrs}{offset} || $self->{attrs}{rows})) {
+    return $self->next::method;
+  }
   $self->{storage}->dbh_do($self->can('_dbh_all'), $self);
 }
 
@@ -164,6 +167,7 @@ sub DESTROY {
   my ($self) = @_;
 
   # None of the reasons this would die matter if we're in DESTROY anyways
+  local $@;
   eval { $self->{sth}->finish if $self->{sth} && $self->{sth}->{Active} };
 }