On Sat, May 24, 2003 at 03:25:38PM -0600, Michael Loftis wrote:
> MySQL 4.0 is ripe with problems like this right now. Databases, tables,
> etc, can be created that can NOT be accessed. The CREATE * functions are
> clearly broken in what they are allowing to be CREATEd as nothing else can
> access them. Just this past Thursday I had to nuke a table without a name
> (.frm, .MYI, and .MYD files). Prior to that we had a table created with
> the name 'what um?' that nothing inside of MySQL could fix because it just
> gave SQL errors, so again had to delete the files.
As the manual explains, you need to escape names that are also reserved works
or contain special characters with backquotes:
http://www.mysql.com/doc/en/Legal_names.html
http://www.mysql.com/doc/en/Reserved_words.html
mysql> create table `fields` (a int);
Query OK, 0 rows affected (0.04 sec)
mysql> insert into `fields` values (1),(2),(3);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from `fields`;
+------+
| a |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> drop table `fields`;
Query OK, 0 rows affected (0.00 sec)
mysql> create table `what um?` (a int);
Query OK, 0 rows affected (0.00 sec)
mysql> insert into `what um?` values (1),(2),(3);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from `what um?`;
+------+
| a |
+------+
| 1 |
| 2 |
| 3 |
+------+
3 rows in set (0.00 sec)
mysql> drop table `what um?`;
Query OK, 0 rows affected (0.00 sec)
Jim Winstead
MySQL AB