Re-added software-based LIMIT support for non-LIMIT-supporting databases
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Cursor.pm
index 143425b..67476c7 100644 (file)
@@ -24,6 +24,11 @@ sub next {
   my $sth = $self->{sth};
   unless ($self->{live_sth}) {
     $sth->execute(@{$self->{args} || []});
+    if ($self->{attrs}{software_limit}) {
+      if (my $offset = $self->{attrs}{offset}) {
+        $sth->fetch for 1 .. $offset;
+      }
+    }
     $self->{live_sth} = 1;
   }
   my @row = $sth->fetchrow_array;