Bug #50883 | If field name is "desc", MySQL fails without meaningful error message. | ||
---|---|---|---|
Submitted: | 3 Feb 2010 14:55 | Modified: | 3 Feb 2010 15:18 |
Reporter: | Sasha Shepherd | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Errors | Severity: | S3 (Non-critical) |
Version: | 5.1 | OS: | Linux (Shared Host) |
Assigned to: | CPU Architecture: | Any | |
Tags: | error code, FATAL ERROR, syntax error |
[3 Feb 2010 14:55]
Sasha Shepherd
[3 Feb 2010 15:18]
Valeriy Kravchuk
This is NOT a bug. DESC is a reserved word and must be quoted. Looks like PHPMyAdmin did a quting job for you when you had created that table. Look: mysql> create table tdesc(desc 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 'desc int)' at line 1 mysql> create table tdesc(`desc` int); Query OK, 0 rows affected (0.06 sec) mysql> insert into tdesc(desc) values(1); 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 'desc) values(1)' at line 1 mysql> insert into tdesc(`desc`) values(1); Query OK, 1 row affected (0.01 sec) Read http://dev.mysql.com/doc/refman/5.1/en/identifiers.html and http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html.