use lib qw(t/lib);
use DBICTest;
use DBIC::SqlMakerTest;
+use DBIx::Class::SQLMaker::LimitDialects;
+
+my ($TOTAL, $OFFSET) = (
+ DBIx::Class::SQLMaker::LimitDialects->__total_bindtype,
+ DBIx::Class::SQLMaker::LimitDialects->__offset_bindtype,
+);
my $s = DBICTest->init_schema (no_deploy => 1, );
$s->storage->sql_maker->limit_dialect ('RowNum');
SELECT foo.id AS id, bar.id AS bar__id, TO_CHAR(foo.womble, "blah") AS bleh
FROM cd me
) me
- WHERE ROWNUM <= 4
+ WHERE ROWNUM <= ?
) me
- WHERE rownum__index >= 4
+ WHERE rownum__index >= ?
)',
- [],
+ [
+ [ $TOTAL => 4 ],
+ [ $OFFSET => 4 ],
+ ],
'Rownum subsel aliasing works correctly'
);
SELECT foo.id AS id, ends_with_me.id AS ends_with_me__id
FROM cd me
) me
- WHERE ROWNUM <= 5
+ WHERE ROWNUM <= ?
) me
- WHERE rownum__index >= 4
+ WHERE rownum__index >= ?
)',
- [],
+ [
+ [ $TOTAL => 5 ],
+ [ $OFFSET => 4 ],
+ ],
'Rownum subsel aliasing works correctly'
);