[Typo3-dev] MySQL and column-name quoting...
Jochen Weiland
nospam at jweiland.net
Tue Jun 7 21:21:39 CEST 2005
Sebastian Voitzsch wrote:
> Hello,
>
> today I tried installing typo3 on a webserver with MySQL 4.1. The installation
> failed bec. some of the databases could not created properly. I found that
> all SQL-statemens containing a "hash"-column caused a SQL syntax error. I
> presume "hash" is a reserved word as of version 4.1 (maybe bec. of the
> ssl-support added in 4.1?). The solution would be to quote all column names
> with backticks (hash -> `hash`). While it is enough to quote only the hash
> columns by now, it seems to be a cleaner solution to quote all column names
> to prevent further incompatibilities with later releases of MySQL.
>
> Also I had some trouble with the database.sql-file; there were quoting errors
> as well. MySQL offers a funciton to produce dumps with quotes, I think this
> should be the default setting for producing sample databases.
>
> Cheereo,
> Sebastian
>
Looks like we are getting into a general problem here with mysql
versions. One idea would be to add the identifier in general - but that
causes incompatibility with mysql before version 4.1. From the mysql
manual:
"Before MySQL 4.1, identifier quote characters should not be used in
identifiers."
When trying to import a sql file with identifiers into mysql <4.1 you
get an error message, that there are no create table commands in the
file - but they are there...
So actually we might need two versions of sql files, one with and one
without identifier quotes. It really becomes messy, when both ways are
mixed, like in the last update of the direct_mail extension.
Jochen
More information about the TYPO3-dev
mailing list