From: Rafael Kitover Date: Thu, 31 Dec 2009 17:55:50 +0000 (+0000) Subject: failing test X-Git-Tag: v0.08116~75^2~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=62d4dbae26097a2343db24eb52722e91372c355a failing test --- diff --git a/t/73oracle.t b/t/73oracle.t index bb5a86e..b2f056c 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -124,12 +124,23 @@ my $new = $schema->resultset('Artist')->create({ name => 'foo' }); is($new->artistid, 1, "Oracle Auto-PK worked"); my $cd = $schema->resultset('CD')->create({ artist => 1, title => 'EP C', year => '2003' }); -is($new->artistid, 1, "Oracle Auto-PK worked - using scalar ref as table name"); +is($cd->cdid, 1, "Oracle Auto-PK worked - using scalar ref as table name"); # test again with fully-qualified table name $new = $schema->resultset('ArtistFQN')->create( { name => 'bar' } ); is( $new->artistid, 2, "Oracle Auto-PK worked with fully-qualified tablename" ); +# test rel names over the 30 char limit +my $query = $schema->resultset('Artist')->search({ + 'cds_very_very_very_long_relationship_name.title' => 'EP C' +}, { + prefetch => 'cds_very_very_very_long_relationship_name' +}); + +lives_and { + is $query->first->cds_very_very_very_long_relationship_name->cdid, 1 +} 'query with rel name over 30 chars survived and worked'; + # test join with row count ambiguity my $track = $schema->resultset('Track')->create({ trackid => 1, cd => 1, diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index 4bc0b5c..dd5028e 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -44,6 +44,9 @@ __PACKAGE__->has_many( __PACKAGE__->has_many( cds_unordered => 'DBICTest::Schema::CD' ); +__PACKAGE__->has_many( + cds_very_very_very_long_relationship_name => 'DBICTest::Schema::CD' +); __PACKAGE__->has_many( twokeys => 'DBICTest::Schema::TwoKeys' ); __PACKAGE__->has_many( onekeys => 'DBICTest::Schema::OneKey' );