Problem with table 'key' and similar 'keys' etc.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.1 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mysql-server-5.1
Package : 5.1.41-3ubuntu12.7
Release : Ubuntu 10.04.1 LTS
After creating table with the name 'key', 'keys' or other similar names, beginning with 'key', cant access this table no more.
mysql> CREATE TABLE `asd` ( `key_id` int(11) NOT NULL auto_increment , PRIMARY KEY (`key_id`));
Query OK, 0 rows affected (0.07 sec)
mysql> select * from asd;
Empty set (0.00 sec)
mysql> drop table asd;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE `key` ( `key_id` int(11) NOT NULL auto_increment , PRIMARY KEY (`key_id`));
Query OK, 0 rows affected (0.04 sec)
mysql> select * from key;
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 'key' at line 1
mysql> drop table key;
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 'key' at line 1
Hello Dmitry, thank you for taking the time to file this bug report and help us make Ubuntu better!
The statement
select * from key;
does indeed have a reserved word, key, that is unquoted, and so its syntax is invalid.
select * from `key`;
Works fine.
Closing as Invalid.