Bug #38583 Parser error messages are meaningless.
Submitted: 5 Aug 2008 19:41 Modified: 16 Oct 2008 3:50
Reporter: Chris Rossi Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.0.51b-community-nt MySQL Community Edi OS:Windows
Assigned to: Assigned Account CPU Architecture:Any
Tags: error messages

[5 Aug 2008 19:41] Chris Rossi
Description:
Error messages are meaningless in MySQL.  I have not seen an error message in MySQL that actually points out to the user what the error is.

How to repeat:
Here's an example.  In this case I had declared a foreign key constraint referencing a table that hadn't been created yet.  The fix was simply to change the order of the table declarations, but the error message gave absolutely no indication of what the problem was:

ERROR 1005 (HY000) at line 39: Can't create table '.\cytunes\album.frm' (errno: 150)

As another example, just about any syntax error yields an error message similar to this one:

ERROR 1064 (42000) at line 40: 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 ')' at line 12

I managed to create that one by putting a comma where it wasn't supposed to be, but, again, nothing in the error message indicated what I had done wrong.

These vague error messages make problems that could be resolved in minutes take hours to resolve, because the feedback is so vague as to be useless.

Suggested fix:
Create meaningful error messages.
[6 Aug 2008 0:08] MySQL Verification Team
Thank you for the bug report.
[8 Oct 2008 19:54] Konstantin Osipov
The suggestion is to make parser error messages more context dependent (print what is expected, etc.).
[23 Mar 2013 8:25] David Nechodom
Today, I encountered "Error 1607: Cannot create stored routine `spc_reset_bucket_firsts`. Check warnings ..." when attempting to submit a modified version of an existing routine. Where are the warnings? Does anyone have a clue why I couldn't create the routine? After three hours of fruitless butchery on the code, I happened to remove the comment. Imagine my shock when what remained of my code produced a new procedure! Over the next two hours, I added, then removed, various chucks of code until I finally determined that the culprit all along was a half-dozen too many characters in the comment! Can anyone tell me how a person would know that from the error message?