X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FDB2.pm;h=a47cd9dac19fcd5a926f349cc2beb282713f7f9d;hb=802a117545a5bd1a5d20152835a3aa7fb2e7b39f;hp=142f37b524192a0d861bc2421bf74701e0c93aba;hpb=075473b9d1011fd8543989000a788f3d25015734;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm index 142f37b..a47cd9d 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm @@ -13,7 +13,7 @@ use namespace::clean; use DBIx::Class::Schema::Loader::Table (); -our $VERSION = '0.07028'; +our $VERSION = '0.07041'; =head1 NAME @@ -75,7 +75,7 @@ EOF my ($col, $constname, $seq) = @$row; push(@{$keydata{$constname}}, [ $seq, $self->_lc($col) ]); } - foreach my $keyname (keys %keydata) { + foreach my $keyname (sort keys %keydata) { my @ordered_cols = map { $_->[1] } sort { $a->[0] <=> $b->[0] } @{$keydata{$keyname}}; push(@uniqs, [ $keyname => \@ordered_cols ]); @@ -152,11 +152,14 @@ EOF } -# DBD::DB2 doesn't follow the DBI API for ->tables +# DBD::DB2 doesn't follow the DBI API for ->tables (pre 1.85), but since its +# backwards compatible we don't change it. +# DBD::DB2 1.85 and beyond default TABLE_NAME to '', previously defaulted to +# '%'. so we supply it. sub _dbh_tables { my ($self, $schema) = @_; - return $self->dbh->tables($schema ? { TABLE_SCHEM => $schema } : undef); + return $self->dbh->tables($schema ? { TABLE_SCHEM => $schema, TABLE_NAME => '%' } : undef); } sub _columns_info_for {