Skip Menu |

This queue is for tickets about the Class-DBI-mysql CPAN distribution.

Report information
The Basics
Id: 4216
Status: resolved
Priority: 0/
Queue: Class-DBI-mysql

People
Owner: Nobody in particular
Requestors: LTHEGLER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.21
Fixed in: (no value)



Subject: [PATCH] set_up_table and FetchHashKeyName
When FetchHashKeyName != 'NAME_lc', set_up_table() breaks, since it assumes all keys are lowercase. I haven't found any more elegant way of solving this, other that lower-casing all the keys in the result hash, as per attached patch. /Lars
--- /usr/local/lib/perl5/site_perl/5.8.1/Class/DBI/mysql.pm.orig Wed Oct 22 14:36:40 2003 +++ /usr/local/lib/perl5/site_perl/5.8.1/Class/DBI/mysql.pm Wed Oct 22 15:12:55 2003 @@ -62,6 +62,7 @@ (my $sth = $class->sql_desc_table)->execute; my (@cols, @pri); while (my $hash = $sth->fetch_hash) { + map {$hash->{lc $_} = delete $hash->{$_}} keys %$hash; # handle uc/lc my ($col) = $hash->{field} =~ /(\w+)/; push @cols, $col; push @pri, $col if $hash->{key} eq "PRI";
Date: Mon, 27 Oct 2003 10:02:18 +0000
From: Tony Bowden <tony [...] kasei.com>
To: via RT <bug-Class-DBI-mysql [...] rt.cpan.org>
Subject: Re: [cpan #4216] [PATCH] set_up_table and FetchHashKeyName
RT-Send-Cc:
On Mon, Oct 27, 2003 at 04:26:41AM -0500, via RT wrote: Show quoted text
> When FetchHashKeyName != 'NAME_lc', set_up_table() breaks, since it > assumes all keys are lowercase. I haven't found any more elegant way of > solving this, other that lower-casing all the keys in the result hash, > as per attached patch.
Yes, that's correct, and deliberate. Class::DBI is documented to need NAME_lc. I'm reluctant to change Class::DBI::mysql because of this. Tony