Author: turnstep
Date: Mon Jan 14 19:17:46 2008
New Revision: 10551

Modified:
   DBD-Pg/trunk/Changes
   DBD-Pg/trunk/Pg.pm

Log:
Quick fix for bug 32308, corner case error with foreign_key_info


Modified: DBD-Pg/trunk/Changes
==============================================================================
--- DBD-Pg/trunk/Changes        (original)
+++ DBD-Pg/trunk/Changes        Mon Jan 14 19:17:46 2008
@@ -1,9 +1,11 @@
 ('GSM' is Greg Sabino Mullane, [EMAIL PROTECTED])
 
 2.0.0
+       - Skip item if no matching key in foreign_key_info.
+               (CPAN bug #32308) [GSM]
        - Overhaul COPY functions: deprecate pg_getline, pg_putline, 
                and pg_endcopy. The new functions are pg_getcopydata, 
-               pg_getcopydata_asyn, pg_putcopydata, and pg_putcopyend. [GSM]
+               pg_getcopydata_async, pg_putcopydata, and pg_putcopyend. [GSM]
        - Change $dbh->{User} to $dbh->{Username} [GSM]
        - Add three new columns to column_info, to return unquoted 
                version: pg_schema, pg_table, and pg_columns. Add all 

Modified: DBD-Pg/trunk/Pg.pm
==============================================================================
--- DBD-Pg/trunk/Pg.pm  (original)
+++ DBD-Pg/trunk/Pg.pm  Mon Jan 14 19:17:46 2008
@@ -935,11 +935,14 @@
                                ## Mark this as an index so we can fudge things 
later on
                                $multi = "index";
                                ## Grab the first one found, modify later on as 
needed
-                               $u = (values 
%{$ukey{$t->{'confrelid'}}})[0]->[0];
+                               $u = ((values 
%{$ukey{$t->{'confrelid'}}})[0]||[])->[0];
+                               ## Bail in case there was no match
+                               next if ! ref $u;
                        }
 
                        ## ODBC is primary keys only
                        next if $odbc and ($u->{'contype'} ne 'p' or $multi eq 
'index');
+
                        my $conkey = $t->{'conkey'};
                        my $confkey = $t->{'confkey'};
                        for (my $y=0; $conkey->[$y]; $y++) {

Reply via email to