From: Brandon Black Date: Thu, 29 Mar 2007 13:16:30 +0000 (+0000) Subject: fixed compat problems w/ DBD::mysql 4.002+, bumped version to 0.03010 for release X-Git-Tag: 0.03010 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Ftags%2F0.03010;hp=a0cc2498ec2d8a8db496bfbc7004ae8a54ac53a1;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fixed compat problems w/ DBD::mysql 4.002+, bumped version to 0.03010 for release --- diff --git a/Changes b/Changes index 0e6f83f..d578803 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension DBIx::Class::Schema::Loader +0.03010 Thu Mar 29 12:36:19 UTC 2007 + - Workaround for new incompatible changes in DBD::mysql's "tables" + method, which was causing us to find no tables w/ DBD::mysql + 4.002+ - Fixed quoting problem in _table_columns (could cause crash when dumping/doing a static create) (from ash) diff --git a/lib/DBIx/Class/Schema/Loader.pm b/lib/DBIx/Class/Schema/Loader.pm index 03a8cce..eb79ca2 100644 --- a/lib/DBIx/Class/Schema/Loader.pm +++ b/lib/DBIx/Class/Schema/Loader.pm @@ -12,7 +12,7 @@ use Scalar::Util qw/ weaken /; # Always remember to do all digits for the version even if they're 0 # i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports # brain damage and presumably various other packaging systems too -our $VERSION = '0.03009'; +our $VERSION = '0.03010'; __PACKAGE__->mk_classaccessor('dump_to_dir'); __PACKAGE__->mk_classaccessor('loader'); diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index 7d4afca..c7e7923 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -27,6 +27,22 @@ See L. =cut +# had to override here because MySQL apparently +# doesn't support '%' syntax. Perhaps the other +# drivers support this syntax also, but I didn't +# want to risk breaking some esoteric DBD::foo version +# in a maint release... +sub _tables_list { + my $self = shift; + + my $dbh = $self->schema->storage->dbh; + my @tables = $dbh->tables(undef, $self->db_schema, undef, undef); + s/\Q$self->{_quoter}\E//g for @tables; + s/^.*\Q$self->{_namesep}\E// for @tables; + + return @tables; +} + sub _table_fk_info { my ($self, $table) = @_;