X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSQLMaker%2FLimitDialects.pm;h=8e85ac8473b5b4ce8f435bfa8c4898e6f4340e79;hb=8b31f62e2b395fba451c32e0bbfecbd3e0f673f8;hp=56f2d5304351e68ddb6d3ded55c48126759eecde;hpb=10419db5494d63347dd0f799f8af23d6d3440f62;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/SQLMaker/LimitDialects.pm b/lib/DBIx/Class/SQLMaker/LimitDialects.pm index 56f2d53..8e85ac8 100644 --- a/lib/DBIx/Class/SQLMaker/LimitDialects.pm +++ b/lib/DBIx/Class/SQLMaker/LimitDialects.pm @@ -169,13 +169,13 @@ sub _SkipFirst { return sprintf ('SELECT %s%s%s%s', $offset ? do { - push @{$self->{limit_bind}}, [ $self->__offset_bindtype => $offset]; + push @{$self->{pre_select_bind}}, [ $self->__offset_bindtype => $offset]; 'SKIP ? ' } : '' , do { - push @{$self->{limit_bind}}, [ $self->__rows_bindtype => $rows ]; + push @{$self->{pre_select_bind}}, [ $self->__rows_bindtype => $rows ]; 'FIRST ? ' }, $sql, @@ -199,12 +199,12 @@ sub _FirstSkip { return sprintf ('SELECT %s%s%s%s', do { - push @{$self->{limit_bind}}, [ $self->__rows_bindtype => $rows ]; + push @{$self->{pre_select_bind}}, [ $self->__rows_bindtype => $rows ]; 'FIRST ? ' }, $offset ? do { - push @{$self->{limit_bind}}, [ $self->__offset_bindtype => $offset]; + push @{$self->{pre_select_bind}}, [ $self->__offset_bindtype => $offset]; 'SKIP ? ' } : '' @@ -390,11 +390,9 @@ sub _prep_for_skimming_limit { $r{mid_sel} .= ', ' . $extra_order_sel->{$extra_col}; } - # since whatever order bindvals there are, they will be realiased - # and need to show up in front of the entire initial inner subquery - # *unshift* the selector bind stack to make this happen (horrible, - # horrible, but we don't have another mechanism yet) - unshift @{$self->{select_bind}}, @{$self->{order_bind}}; + # Whatever order bindvals there are, they will be realiased and + # need to show up in front of the entire initial inner subquery + push @{$self->{pre_select_bind}}, @{$self->{order_bind}}; } # and this is order re-alias magic