contao/test — Issue #2048: Exception when changing collation durring install
Author: importer
Created: 2011-11-29 09:01:50+00:00
State: open
Labels: backend, Defect, Invalid

While updating a domain from 2.8.0 to 2.8.3 I had to go throu the install.php again. I wanted to update the collation but there were some problems:

```
Fatal error: Uncaught exception Exception with message Query error: 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 'key key varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ' at line 1 (ALTER TABLE tl_ecards CHANGE key key varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '') thrown in /var/www/clients/client3/web3/web/system/libraries/Database.php on line 599

#0 /var/www/clients/client3/web3/web/system/libraries/Database.php(187): Database_Statement->query('ALTER TABLE tl_...')
#1 /var/www/clients/client3/web3/web/typolight/install.php(498): Database->query('ALTER TABLE tl_...')
#2 /var/www/clients/client3/web3/web/typolight/install.php(1039): InstallTool->run()
#3 {main}
```

It looks like the table and column names are not escaped in the SQL statement. (And probably in this MySQL version "key" is now a forbidden word. That's why realised this problem till now.)

--- _Originally created by modir on May 27th, 2010, at 05:23pm (ID 2048)_