From: Rafael Kitover Date: Wed, 14 Mar 2012 18:10:26 +0000 (-0400) Subject: fix undef warn in fk info for DBDs without schemas X-Git-Tag: 0.07018~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ba9954e0b9fb55c31a679689ce4246ecdcd4b45e;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix undef warn in fk info for DBDs without schemas SineSwiper reported an undef warning from ::DBI in _table_fk_info because of an s/// substitution on the schema values extracted from $dbh->foreign_key_info, which can be undef for DBDs which do not have the concept of schemas. Change the substitution to only run if the values are defined. --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index 1ed2fee..266eb50 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -405,7 +405,7 @@ sub _table_fk_info { my $relid = ($raw_rel->[11] || ( "__dcsld__" . $i++ )); foreach my $var ($uk_scm, $uk_tbl, $uk_col, $fk_scm, $fk_col, $relid) { - $var =~ s/[\Q$self->{quote_char}\E]//g; + $var =~ s/[\Q$self->{quote_char}\E]//g if defined $var; } if ($self->db_schema && $self->db_schema->[0] ne '%'