Class::DBI::Loader::mysql bug: not finding all tables

[prev] [thread] [next] [Date index for 2005/04/05]

From: Andy Grundman
Subject: Class::DBI::Loader::mysql bug: not finding all tables
Date: 18:57 on 05 Apr 2005
I ran into a bug relating to this section of the Loader mysql module:

     foreach my $table ( $dbh->tables ) {
         my $quoter = $dbh->get_info(29);
         $table =~ s/$quoter//g;
         push @tables, $1
           if $table =~ /\A(\w+)\z/;
     }

Out of 4 simple tables in my database (accounts, categories, 
transactions, users), this would only pick up the first table 
(accounts).  The $quoter replacement was wiping out all 3 of my other 
table names.  I fixed the problem with the following code and it now 
loads all 4 of my tables.

$table =~ s/$quoter//g if ($quoter);

On a side note, is there any documentation on how to autoload 
relationships in MySQL using table comments?  Maybe I should just try 
Loader::Relationship and specify it in English. :)

Thanks,
-Andy

Class::DBI::Loader::mysql bug: not finding all tables
Andy Grundman 18:57 on 05 Apr 2005

Generated at 14:42 on 11 Apr 2005 by mariachi v0.52