Re: Doubled column definitions

[prev] [thread] [next] [Date index for 2004/12/30]

From: Drew Taylor
Subject: Re: Doubled column definitions
Date: 19:00 on 30 Dec 2004
On Thu, 30 Dec 2004 18:24:50 +0000, Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote:
> On Thu, Dec 30, 2004 at 08:45:33AM -0500, Drew Taylor wrote:
> > > A test script that shows the problem would be very handy.
> > use Class::DBI::Loader;
> > my $loader = Class::DBI::Loader->new
> >     (namespace=>"Foo",
> >      dsn=>'dbi:mysql:recipes',
> >      user=>'',
> >      password=>'',
> >      );
> 
> I'd rather have one that didn't use Class::DBI::Loader, so that it's
> obvious that the problem is with Class::DBI itself, rather than Loader.

Fair enough. This is one using Class::DBI::mysql directly. I'm pretty
sure the problem is within CDBI, but it's complicated enough that I'm
not sure. The database schema is the same as before.

#!/usr/bin/perl
use strict;
use warnings;
use Class::DBI::mysql;


package Bad;
use strict;
use base 'Class::DBI::mysql';
__PACKAGE__->connection('dbi:mysql:recipes', 'recipe', 'recipe');
__PACKAGE__->set_up_table('BadColumns');
1;

package Good;
use strict;
use base 'Class::DBI::mysql';
__PACKAGE__->connection('dbi:mysql:recipes', 'recipe', 'recipe');
__PACKAGE__->set_up_table('goodcolumns');
1;

package main;
my @classes = qw(Bad Good);
foreach (@classes) {
  my @columns = $_->columns;
  print "Table: [$_] Columns [@columns]\n";
}

Drew
        -- 
        ----------------------------------------------------------------
 Drew Taylor                 *  Web development & consulting
 Email: drew@xxxxxxxxxx.xxx  *  Site implementation & hosting
 Web  : www.drewtaylor.com   *  perl/mod_perl/DBI/mysql/postgres
 ----------------------------------------------------------------

(message missing)

Doubled column definitions
Drew Taylor 05:21 on 30 Dec 2004

Re: Doubled column definitions
Tony Bowden 09:55 on 30 Dec 2004

Re: Doubled column definitions
Drew Taylor 13:45 on 30 Dec 2004

Re: Doubled column definitions
Tony Bowden 18:24 on 30 Dec 2004

Re: Doubled column definitions
Drew Taylor 19:00 on 30 Dec 2004

Re: Doubled column definitions
Drew Taylor 19:59 on 30 Dec 2004

Re: Doubled column definitions
Tony Bowden 22:18 on 30 Dec 2004

Re: Doubled column definitions
Drew Taylor 01:29 on 31 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52