X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=1320f161cb8295fa542b11d01b07105c343cbe24;hp=0efff67d5b4e669243acb5c3064591775ba0aa43;hb=75f025cf247e75869dcdfe46b37e24d4e0b15e8b;hpb=7ad315356c82a425365b88b6146617485897a4a0 diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 0efff67..1320f16 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1922,19 +1922,13 @@ sub _select_args { } # adjust limits - if ( - $attrs->{software_limit} - || - $sql_maker->_default_limit_syntax eq "GenericSubQ" - ) { - $attrs->{software_limit} = 1; - } - else { + if (defined $attrs->{rows}) { $self->throw_exception("rows attribute must be positive if present") - if (defined($attrs->{rows}) && !($attrs->{rows} > 0)); - + unless $attrs->{rows} > 0; + } + elsif (defined $attrs->{offset}) { # MySQL actually recommends this approach. I cringe. - $attrs->{rows} = 2**48 if not defined $attrs->{rows} and defined $attrs->{offset}; + $attrs->{rows} = 2**32; } my @limit;