[CDBI] Reserved words in MySQL
cvicente at network-services.uoregon.edu
Tue Dec 12 22:09:00 GMT 2006
After upgrading to MySQL5 I started getting errors caused by some of my
tables having names that are now reserved words (e.g. "Connection"), so
Connection can't SELECT id, name, entity, nearend, farend
: DBD::mysql::st execute failed: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'Connection' at line 2 [for Statement "SELECT
id, name, entity, nearend, farend
"] at /usr/lib/perl5/site_perl/5.8.7/DBIx/ContextualFetch.pm line 52.
In looking for possible solutions, I noticed the table_alias method, but
I'm not convinced that that's of any use here. I'm trying to not have
to rename the table.
I fixed the db creation scripts by wrapping the table names in backticks
(``), but I can't control how Class::DBI builds its SQL. It'd be great
if this could be turned on somewhere globally.
More information about the ClassDBI