Bug #1095 Cannot create a table called "con"
Submitted: 19 Aug 2003 6:24 Modified: 19 Aug 2003 10:25
Reporter: Travis Basevi Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.0-alpha OS:Windows (Windows 2000)
Assigned to: Paul DuBois CPU Architecture:Any

[19 Aug 2003 6:24] Travis Basevi
Description:

Bizarrely, I cannot create a table called con, it seems to think it already exists:

mysql> create database blah;
Query OK, 1 row affected (0.05 sec)

mysql> use blah;
Database changed
mysql> create table con (blahblah int);
ERROR 1050: Table 'con' already exists
mysql> show tables;
Empty set (0.01 sec)

mysql> drop table if exists con;
ERROR 6: Error on delete of '.\blah\con.MYI' (Errcode: 2)

mysql> create table con1 (blahblah int);
Query OK, 0 rows affected (0.03 sec)

mysql> rename table con1 to con;
ERROR 1050: Table './blah/con.frm' already exists

mysql> show tables;
+----------------+
| Tables_in_blah |
+----------------+
| con1           |
+----------------+
1 row in set (0.00 sec)

How to repeat:

As above.

It's also specific to the Windows release. The above all works fine on Linux.

There's nothing in the directory to suggest a problem either:

D:\>cd mysql\data\blah

D:\mysql\data\blah>dir
 Volume in drive D has no label.
 Volume Serial Number is C0F5-B320

 Directory of D:\mysql\data\blah

19/08/2003  14:20       <DIR>          .
19/08/2003  14:20       <DIR>          ..
19/08/2003  14:17                8,568 con1.frm
19/08/2003  14:17                    0 con1.MYD
19/08/2003  14:17                1,024 con1.MYI
19/08/2003  14:11                   40 db.opt
               4 File(s)          9,632 bytes
               2 Dir(s)  12,296,916,992 bytes free
[19 Aug 2003 10:25] Paul DuBois
This is not a bug. You will find that the same
problem occurs for table names such as prn
or nul as well. This is due to the way that
Windows treats filenames beginning with
these words as reserved filenames, coupled
with the fact that MySQL creates files based
on the table name.