From: Robert Buels Date: Wed, 21 Oct 2009 00:38:59 +0000 (+0000) Subject: more pg unqualified schema tests, which expose a gap in the coverage X-Git-Tag: v0.08113~19^2~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=78c9596c362a29bf8ec2a27924c708f9e161936d;p=dbsrgits%2FDBIx-Class.git more pg unqualified schema tests, which expose a gap in the coverage --- diff --git a/t/72pg.t b/t/72pg.t index d6cb0a9..4ff5964 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -492,7 +492,7 @@ sub run_extended_apk_tests { $dbh->do("CREATE SEQUENCE $eapk_schemas[4].fooseq"); $dbh->do("CREATE SEQUENCE $eapk_schemas[3].fooseq"); - $dbh->do("SET search_path = ".join ',', @eapk_schemas ); + $dbh->do("SET search_path = ".join ',', reverse @eapk_schemas ); }); # clear our search_path cache @@ -519,12 +519,14 @@ sub run_extended_apk_tests { qualify_table => 4, ); + eapk_poke( $schema ); eapk_poke( $schema, 0 ); eapk_poke( $schema, 2 ); eapk_poke( $schema, 4 ); eapk_poke( $schema, 1 ); eapk_poke( $schema, 0 ); eapk_poke( $schema, 1 ); + eapk_poke( $schema ); eapk_poke( $schema, 4 ); eapk_poke( $schema, 3 ); eapk_poke( $schema, 1 ); @@ -547,7 +549,7 @@ sub eapk_poke { ? $eapk_schemas[$schema_num] : ''; - my $schema_name_actual = $schema_name || eapk_get_search_path($s)->[0]; + my $schema_name_actual = $schema_name || eapk_find_visible_schema($s); $s->source('ExtAPK')->name($schema_name ? $schema_name.'.apk' : 'apk'); #< clear sequence name cache @@ -577,7 +579,7 @@ sub eapk_poke { # class sub eapk_seq_diag { my $s = shift; - my $schema = shift || eapk_get_search_path($s)->[0]; + my $schema = shift || eapk_find_visible_schema($s); diag "$schema.apk sequences: ", join(', ', @@ -667,3 +669,19 @@ sub eapk_drop_all { }); } + +sub eapk_find_visible_schema { + my ($s) = @_; + + my ($schema) = + $s->storage->dbh_do(sub { + $_[1]->selectrow_array(<