Skip Menu |

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

Report information
The Basics
Id: 45567
Status: rejected
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: pshangov [...] yahoo.com
Cc:
AdminCc:

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



Subject: DBIC::SQL::Abstract problems with tables whose names are reserved words
DBIx::Class fails to work with tables whose names are reserved SQL keywords (e.g. "group"). I get the following error DBIx::Class::Schema::Loader::make_schema_at(): DBI Exception: DBD::SQLite::db prepare failed: near "group": syntax error [for Statement "SELECT * FROM group WHERE ( 1 = 0 )"] at C:/strawberry/perl/site/lib/Catalyst/Helper/Model/DBIC/Schema.pm line 173 I traced this down to DBIC::SQL::Abstract, which has the following code: sub select { my ($self, $table, $fields, $where, $order, @rest) = @_; $table = $self->_quote($table) unless ref($table); SQL::Abstract has a "quote_char" option which is empty by default and if it is not set "$self->_quote($table)" has no effect. DBIx::Class should provide the user with an option to use a quote character when generating queries.
On Wed Apr 29 14:12:50 2009, pshangov wrote: Show quoted text
> ... DBIx::Class should > provide the user with an option to use a quote character when generating > queries.
And lo and behold - it does :) http://search.cpan.org/~ribasushi/DBIx-Class-0.08101/lib/DBIx/Class/Storage/DBI.pm#DBIx::Class_specific_connection_attributes Rejecting bug, as classic RTFM.