From: Matt S Trout Date: Fri, 3 Aug 2007 18:52:16 +0000 (+0000) Subject: optimisation in cursor X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6296f45bb9f999c00a65f2535a8d3685287844b0;p=dbsrgits%2FDBIx-Class-Historic.git optimisation in cursor --- diff --git a/Changes b/Changes index b86c2b5..8635a41 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,7 @@ Revision history for DBIx::Class + + - optimisation in DBI::Cursor to check software_limit before falling + back to base Cursor->all - fix bug with create_multi not inserting non-storage objects (test and fix from davinchi) - DBIx::Class::AccessorGroup made empty subclass of diff --git a/lib/DBIx/Class/Storage/DBI/Cursor.pm b/lib/DBIx/Class/Storage/DBI/Cursor.pm index e6ff5dd..426f72e 100644 --- a/lib/DBIx/Class/Storage/DBI/Cursor.pm +++ b/lib/DBIx/Class/Storage/DBI/Cursor.pm @@ -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->SUPER::all; + } $self->{storage}->dbh_do($self->can('_dbh_all'), $self); }