MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jim Winstead Date:May 24 2003 10:32pm
Subject:Re: Bug? Yes -- CREATE * allow tables, databases, etc, to be created that CAN NOT BE TOUCHED
View as plain text  
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
Thread
3.23 - 4.0 differenceVeysel Harun Sahin24 May
  • Getting the primary key of the row just createdTom Gazzini24 May
    • Re: Getting the primary key of the row just createdVictoria Reznichenko24 May
      • Bug?Urb LeJeune24 May
    • Re: Bug?Roberto Slepetys24 May
      • Re: Bug? Yes -- CREATE * allow tables, databases, etc, to be created that CAN NOT BE TOUCHEDMichael Loftis24 May
        • Re: Bug? Yes -- CREATE * allow tables, databases, etc, to be created that CAN NOT BE TOUCHEDJim Winstead25 May
  • Re: 3.23 - 4.0 differenceEgor Egorov24 May
  • Re: 3.23 - 4.0 differenceVeysel Harun Sahin24 May