From: Matt S Trout Date: Tue, 23 May 2006 21:23:49 +0000 (+0000) Subject: fixed screwed merge of Storage::DBI (my fault :) X-Git-Tag: v0.07002~75^2~177^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5a3dd6fe6f72838c64209fb1e36e397633a65dc;p=dbsrgits%2FDBIx-Class.git fixed screwed merge of Storage::DBI (my fault :) --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 376e48c..9405288 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -21,6 +21,8 @@ sub select { my ($self, $table, $fields, $where, $order, @rest) = @_; $table = $self->_quote($table) unless ref($table); @rest = (-1) unless defined $rest[0]; + die "LIMIT 0 Does Not Compute" if $rest[0] == 0; + # and anyway, SQL::Abstract::Limit will cause a barf if we don't first local $self->{having_bind} = []; my ($sql, @ret) = $self->SUPER::select( $table, $self->_recurse_fields($fields), $where, $order, @rest @@ -430,11 +432,7 @@ sub _populate_dbh { my ($self) = @_; my @info = @{$self->_connect_info || []}; $self->_dbh($self->_connect(@info)); - my $dbh = $self->_dbh; - my $driver = $dbh->{Driver}->{Name}; - if ( $driver eq 'ODBC' and $dbh->get_info(17) =~ m{^DB2/400} ) { - $driver = 'ODBC400'; - } + my $driver = $self->_dbh->{Driver}->{Name}; eval "require DBIx::Class::Storage::DBI::${driver}"; unless ($@) { bless $self, "DBIx::Class::Storage::DBI::${driver}"; @@ -639,6 +637,8 @@ sub _select { $self->sql_maker->_default_limit_syntax eq "GenericSubQ") { $attrs->{software_limit} = 1; } else { + $self->throw_exception("rows attribute must be positive if present") + if (defined($attrs->{rows}) && !($attrs->{rows} > 0)); push @args, $attrs->{rows}, $attrs->{offset}; } return $self->_execute(@args);