8 use DBIC::SqlMakerTest;
10 my $s = DBICTest->init_schema (no_deploy => 1, );
11 $s->storage->sql_maker->limit_dialect ('RowNum');
13 my $rs = $s->resultset ('CD');
16 $rs->search ({}, { rows => 1, offset => 3,columns => [
18 { 'bar.id' => 'bar.id' },
19 { bleh => \ 'TO_CHAR (foo.womble, "blah")' },
22 SELECT id, bar__id, bleh
24 SELECT id, bar__id, bleh, ROWNUM rownum__index
26 SELECT foo.id AS id, bar.id AS bar__id, TO_CHAR(foo.womble, "blah") AS bleh
31 WHERE rownum__index >= 4
34 'Rownum subsel aliasing works correctly'
38 $rs->search ({}, { rows => 2, offset => 3,columns => [
40 { 'ends_with_me.id' => 'ends_with_me.id' },
42 '(SELECT id, ends_with_me__id
44 SELECT id, ends_with_me__id, ROWNUM rownum__index
46 SELECT foo.id AS id, ends_with_me.id AS ends_with_me__id
51 WHERE rownum__index >= 4
54 'Rownum subsel aliasing works correctly'
58 $rs = $s->resultset('Artist')->search({}, {
63 local $rs->result_source->{name} = "weird \n newline/multi \t \t space containing \n table";
66 ${$rs->as_query}->[0],
67 qr| weird \s \n \s newline/multi \s \t \s \t \s space \s containing \s \n \s table|x,
68 'Newlines/spaces preserved in final sql',