Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 24368
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: blblack [...] gmail.com
Requestors: martin-cpan [...] earth.li
Cc:
AdminCc:

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



Subject: Identifiers are not quoted in SELECT used to retrieve column names.
In the DBIx::Class::Schema::Loader::DBI::_table_columns method, a dummy SELECT statement is used to obtain column names. The table name is used unquoted regardless of the quote_char setting associated with the schema's storage. This causes the SELECT to fail for PostgreSQL tables with non-lowercase characters in the table name, as unquoted identifiers are silently treated as lowercase by PostgreSQL. The attached patch against 0.3009 rectifies the problem.
Subject: quote-identifiers-in-column-name-select.patch
--- /usr/share/perl5/DBIx/Class/Schema/Loader/DBI.pm 2006-12-01 15:41:23.000000000 +0000 +++ lib/DBIx/Class/Schema/Loader/DBI.pm 2007-01-15 03:42:15.000000000 +0000 @@ -87,8 +87,11 @@ my $dbh = $self->schema->storage->dbh; + $table = $self->{_quoter} . $table . $self->{_quoter}; + if($self->{db_schema}) { - $table = $self->{db_schema} . $self->{_namesep} . $table; + $table = $self->{_quoter} . $self->{db_schema} . $self->{_quoter} + . $self->{_namesep} . $table; } my $sth = $dbh->prepare("SELECT * FROM $table WHERE 1=0");
On Sun Jan 14 23:11:12 2007, mling wrote: Show quoted text
> In the DBIx::Class::Schema::Loader::DBI::_table_columns method, a dummy > SELECT statement is used to obtain column names. The table name is used > unquoted regardless of the quote_char setting associated with the > schema's storage. This causes the SELECT to fail for PostgreSQL tables > with non-lowercase characters in the table name, as unquoted identifiers > are silently treated as lowercase by PostgreSQL. > > The attached patch against 0.3009 rectifies the problem.
Can you check 0.03010? Ash made some changes to this, and it looks like it might take care of this. -- Brandon
I'm assuming this is resolved in newer releases, closing. Feel free to re-open if necessary.