Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 1446
Status: resolved
Priority: 0/
Queue: SQL-Statement

People
Owner: JZUCKER [...] cpan.org
Requestors: chromatic [...] wgz.org
Cc:
AdminCc:

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



Subject: Inconsistent Capitalization of Table Names
While running the following SQL statement through DBD::AnyData, I received zero rows. I had just inserted a fresh row into the image table. I traced the issue to lowercase table names being used as keys into a hash containing uppercase table names. I am using CSV files created by the DBD::AnyData export process. SELECT oid FROM image i JOIN image_type t ON t.image_type_id = i.image_type_id WHERE i.id = ? AND i.category = '0' The 'category' field was the culprit in this case. The attached patch corrects the issue for me. Applying it causes no tests in 'test.pl' to fail. I am using Perl 5.6.1 for i386 Linux, from the perl-5.6.1-34.99.6 RedHat RPM, on kernel 2.4.18-3.
--- Statement.pm~ Wed Mar 13 13:47:08 2002 +++ Statement.pm Thu Aug 15 02:35:48 2002 @@ -459,8 +459,8 @@ my $tableB; $tableA = shift @tables; $tableB = shift @tables; - my $tableAobj = $eval->table($tableA); - my $tableBobj = $eval->table($tableB); + my $tableAobj = $eval->table(lc $tableA); + my $tableBobj = $eval->table(lc $tableB); $tableAobj->{"REAL_NAME"} = $tableAobj->{"NAME"} ||= $tableA; $tableBobj->{"REAL_NAME"} = $tableBobj->{"NAME"} ||= $tableB; if (my $aliasA = $self->{table_alias}->{$tableA}) { @@ -1383,7 +1382,7 @@ my $val = $structure->{"value"}; my $tbl; if ($val =~ /^(.+)\.(.+)$/ ) { - ($tbl,$val) = ($1,$2); + ($tbl,$val) = (lc $1,$2); } if ($self->{"join"}) { # $tbl = 'shared' if $eval->is_shared($val);
Assigned to the actual maintainer.
RT-Send-CC: JZUCKER [...] cpan.org
Assigned to JZUCKER, the module owner.