X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F73oracle_hq.t;h=af526d9b2ff2f31e31e0294df45e551aa0f3a6a9;hb=5a44a8ec80d92e787407142701d92737c8735877;hp=07c1f409b69f67e4dd6b1d622eaf77d9e785fe43;hpb=fcb7fcbb6bde5f9a211c62011b3110f07828caec;p=dbsrgits%2FDBIx-Class.git diff --git a/t/73oracle_hq.t b/t/73oracle_hq.t index 07c1f40..af526d9 100644 --- a/t/73oracle_hq.t +++ b/t/73oracle_hq.t @@ -3,7 +3,7 @@ use warnings; use Test::Exception; use Test::More; - +use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); use DBIC::SqlMakerTest; @@ -15,14 +15,14 @@ $ENV{NLS_SORT} = "BINARY"; $ENV{NLS_COMP} = "BINARY"; $ENV{NLS_LANG} = "AMERICAN"; -plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_oracle') - unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_oracle'); - my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_ORA_${_}" } qw/DSN USER PASS/}; plan skip_all => 'Set $ENV{DBICTEST_ORA_DSN}, _USER and _PASS to run this test.' unless ($dsn && $user && $pass); +plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_oracle') + unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_oracle'); + use DBICTest::Schema::Artist; BEGIN { DBICTest::Schema::Artist->add_column('parentid'); @@ -316,7 +316,7 @@ do_creates($dbh); my $rs = $schema->resultset('Artist')->search({}, { start_with => { name => 'root' }, connect_by => { parentid => { -prior => { -ident => 'artistid' } } }, - order_by => { -asc => 'name' }, + order_by => [ { -asc => 'name' }, { -desc => 'artistid' } ], rows => 2, }); @@ -329,7 +329,7 @@ do_creates($dbh); FROM artist me START WITH name = ? CONNECT BY parentid = PRIOR artistid - ORDER BY name ASC + ORDER BY name ASC, artistid DESC ) me WHERE ROWNUM <= ? )', @@ -352,17 +352,22 @@ do_creates($dbh); FROM ( SELECT artistid FROM ( - SELECT me.artistid - FROM artist me - START WITH name = ? - CONNECT BY parentid = PRIOR artistid + SELECT artistid, ROWNUM rownum__index + FROM ( + SELECT me.artistid + FROM artist me + START WITH name = ? + CONNECT BY parentid = PRIOR artistid + ) me ) me - WHERE ROWNUM <= ? + WHERE rownum__index BETWEEN ? AND ? ) me )', [ [ { 'sqlt_datatype' => 'varchar', 'dbic_colname' => 'name', 'sqlt_size' => 100 } - => 'root'], [ $ROWS => 2 ] , + => 'root'], + [ $ROWS => 1 ], + [ $TOTAL => 2 ], ], );