add horrific fix to make Oracle's retarded limit syntax work
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI.pm
index 4a72a95..e42b013 100644 (file)
@@ -134,6 +134,14 @@ sub _quote {
   return $self->SUPER::_quote($label);
 }
 
+sub _RowNum {
+   my $self = shift;
+   my $c;
+   $_[0] =~ s/SELECT (.*?) FROM/
+     'SELECT '.join(', ', map { $_.' AS col'.++$c } split(', ', $1)).' FROM'/e;
+   $self->SUPER::_RowNum(@_);
+}
+
 # Accessor for setting limit dialect. This is useful
 # for JDBC-bridge among others where the remote SQL-dialect cannot
 # be determined by the name of the driver alone.