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,
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 ? '
}
: ''
$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
#
# Returns mangled proto-sql, inner/outer strings of SQL QUOTED selectors
# with aliases (to be used in whatever select statement), and an alias
-# index hashref of QUOTED SEL => QUOTED ALIAS pairs (to maybe be used
+# index hashref of QUOTED SEL => QUOTED ALIAS pairs (to maybe be used
# for string-subst higher up).
# If an order_by is supplied, the inner select needs to bring out columns
# used in implicit (non-selected) orders, and the order condition itself