Skip to content

Commit

Permalink
Support for DBD::DB2 1.85 as well as < 1.85
Browse files Browse the repository at this point in the history
IBM attempted to become compatible with the DBI spec with their latest release,
but seem to have failed. This tweak fixes support for all versions of the DBD.
  • Loading branch information
Matt Phillips authored and ilmari committed Jan 2, 2014
1 parent 45b70e6 commit e80ea87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Revision history for Perl extension DBIx::Class::Schema::Loader

- Fix table listing with DBD::DB2 >= 1.85 (RT#91764)

0.07038 2013-11-20
- Allow coderef maps to call back into the hashref mapping code
- Fix MySQL column info detection with multiple schemas (RT#82358)
Expand Down
7 changes: 5 additions & 2 deletions lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e80ea87

Please sign in to comment.