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