Skip Menu |

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

Report information
The Basics
Id: 16142
Status: new
Priority: 0/
Queue: Class-DBI-mysql

People
Owner: Nobody in particular
Requestors: ross.crawford [...] gmail.com
Cc:
AdminCc:

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



Date: Sun, 27 Nov 2005 09:46:40 +1100
From: Ross Crawford <ross.crawford [...] gmail.com>
To: bug-Class-DBI-mysql [...] rt.cpan.org
Subject: Bug retrieving table details if table name is a reserved word
I'm only pretty new to Perl, so forgive me if this doesn't sound right. If I have a table called (for example) Order, the DESCRIBE TABLE fails due to a SQL syntax error. It is generally considered bad design to use reserved words for table (/ column) names, but as mysql can get around the problem by surrounding the table (/ column) name with back-ticks, it would be easy to fix this problem by changing the line: __PACKAGE__->set_sql(desc_table => 'DESCRIBE __TABLE__'); to: __PACKAGE__->set_sql(desc_table => 'DESCRIBE `__TABLE__`'); Other similar instances should probably be changed too. Thanks! ROSCO
Date: Sun, 27 Nov 2005 11:51:38 +0000
From: Tony Bowden <tony [...] kasei.com>
To: Ross Crawford via RT <bug-Class-DBI-mysql [...] rt.cpan.org>
Subject: Re: [cpan #16142] Bug retrieving table details if table name is a reserved word
RT-Send-Cc:
On Sat, Nov 26, 2005 at 05:47:18PM -0500, Ross Crawford via RT wrote: Show quoted text
> Other similar instances should probably be changed too.
What happens if you include the backticks when setting up the table data? __PACKAGE__->set_up_table("`order`"); Tony