Fixed 73oracle.t because of new implementation of connect_by
[dbsrgits/DBIx-Class.git] / t / 73oracle.t
index 3f60930..99e12eb 100644 (file)
@@ -45,14 +45,6 @@ my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
 
 my $dbh = $schema->storage->dbh;
 
-if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
-    plan tests => 46;
-}
-else {
-    plan tests => 36;
-}
-
-
 eval {
   $dbh->do("DROP SEQUENCE artist_seq");
   $dbh->do("DROP SEQUENCE cd_seq");
@@ -437,7 +429,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
     START WITH
         name = ?
     CONNECT BY
-        parentid = prior artistid
+        parentid = PRIOR( artistid )
     ORDER SIBLINGS BY
         name DESC
 
@@ -454,7 +446,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
       my $rs = $schema->resultset('Artist')->search({ parentid => undef },
                               {
                                 'start_with' => { 'name' => 'greatgrandchild' },
-                                'connect_by' => { '-prior' => [  \'parentid', \'artistid' ] } ,
+                                'connect_by' => { 'artistid' => { '-prior' => \'parentid' } },
                               });
 =pod
     SELECT
@@ -466,7 +458,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
     START WITH
         name = ?
     CONNECT BY
-        prior parentid = artistid
+        artistid = PRIOR( parentid )
 
     Parameters: 'greatgrandchild'
 =cut
@@ -537,7 +529,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
       my $rs = $schema->resultset('Artist')->search({},
                               {
                                 'start_with' => { 'name' => 'greatgrandchild' },
-                                'connect_by' => { '-prior' => [ \'parentid', \'artistid' ] },
+                                'connect_by' => { artistid => { '-prior' => \'parentid' } },
                                 'order_by' => 'name ASC',
                               });
       my $ok = 1;
@@ -549,7 +541,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
     START WITH
         name = ?
     CONNECT BY
-        prior parentid = artistid
+        artistid = PRIOR( parentid )
     ORDER BY
         name ASC
 
@@ -566,7 +558,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
       my $rs = $schema->resultset('Artist')->search({},
                               {
                                 'start_with' => { 'name' => 'greatgrandchild' },
-                                'connect_by' => { '-prior' => [ \'parentid', \'artistid' ] },
+                                'connect_by' => { 'artistid' => { '-prior' => \'parentid' } },
                                 'order_by' => 'name ASC',
                                 'rows' => 2,
                                 'page' => 1,
@@ -579,7 +571,7 @@ if ( $schema->storage->isa('DBIx::Class::Storage::DBI::Oracle::Generic') ) {
     START WITH
         name = ?
     CONNECT BY
-        prior parentid = artistid
+        artistid = PRIOR( parentid )
 
     Parameters: 'greatgrandchild'
 =cut