[Dbix-class] ENUM values from MySQL using the column_info()
jmorano at moretrix.com
Fri May 12 13:26:27 CEST 2006
when I try to create a table like that in Mysql (5.x), I get this:
ERROR 1060 (42S21): Duplicate column name 'NAME'
So... why would you like to have columns with the same info / name, one
lowercase and the other uppercase? There are functions, subroutines to
do this type of thing!
I really don't see the added value of your example, it looks like you
need to normalize your tables ;-)
But of course... it doesn't explain why you get the same value twice.
Oh well, ...
On Fri, 2006-05-12 at 12:35 +0200, Zbigniew Lukasiak wrote:
> On 5/12/06, Carl Franks <fireartist at gmail.com> wrote:
> > As far as I know, DBIx::Class doesn't make any effort to try to be
> > case-insensitive, but if your database is, then DBIx::Class may appear
> > to be case-insensitive.
> I don't know how much conscious effor there is but if I have a table
> with two columns with names differing only by case:
> test=# select * from casecheck;
> id | name | NAME
> 1 | aaa | AAA
> (1 row)
> (this is Pg)
> and I define DBIC class columns with the same case:
> __PACKAGE__->add_columns(qw/id name NAME/);
> Then when I retrieve the record and print the values in it's columns:
> my $record = $schema->resultset( 'Casecheck' ) -> find ( 1 );
> print "record->name: ", $record->name, "\n";
> print "record->NAME: ", $record->NAME, "\n";
> I get:
> record->name: aaa
> record->NAME: aaa
> While I would expect the last line to be: record->NAME: AAA
> Summing up - the database is casesensitive, but in DBIC is not (in this case:).
More information about the Dbix-class