Bug #33847 | The character '-' in a table name causes problems | ||
---|---|---|---|
Submitted: | 13 Jan 2008 16:40 | Modified: | 14 Jan 2008 5:20 |
Reporter: | David VANTYGHEM | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.0.45 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | -, name, table |
[13 Jan 2008 16:40]
David VANTYGHEM
[14 Jan 2008 5:20]
Valeriy Kravchuk
This is not a bug. You just have to quote table name properly, both in CREATE and in all other SQL statements. Look: mysql> select version(); +------------------------------+ | version() | +------------------------------+ | 5.0.54-enterprise-gpl-nt-log | +------------------------------+ 1 row in set (0.01 sec) mysql> create table sylibre-installer_Logiciels(nom int); ERROR 1064 (42000): 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 '-inst aller_Logiciels(nom int)' at line 1 mysql> create table `sylibre-installer_Logiciels`(nom int); Query OK, 0 rows affected (0.61 sec) mysql> SELECT * FROM sylibre-installer_Logiciels ORDER BY nom; ERROR 1064 (42000): 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 '-inst aller_Logiciels ORDER BY nom' at line 1 mysql> SELECT * FROM `sylibre-installer_Logiciels` ORDER BY nom; Empty set (0.03 sec)