Bug #67588 The error message for syntax errors is ridiculously difficult to read
Submitted: 14 Nov 2012 17:44 Modified: 15 Nov 2012 19:59
Reporter: matteo sisti sette Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.5.27 OS:Any
Assigned to: CPU Architecture:Any

[14 Nov 2012 17:44] matteo sisti sette
Description:
I know this error message is a beautiful piece of history:

"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 ..."

Then print it and expose it in a museum, but please remove it from current versions of the software that are meant to be (and actually are) used.

As a developer, this is one of the worst ways of reporting an error I've ever seen in a modern computer language.

* To start with, it's ridiculously long. "You have an error in your SQL syntax" can be reduced to "SQL Syntax error;"

* The part "Check the manual bla bla..... syntax to use" is completely useless and can be removed safely without loosing a bit of information.

* For god's sake at the very least replace "NEAR" with "JUST BEFORE"

* Explain what's wrong with the syntax. "Unexpected token '...'", or whatever.

One stares at the error message and half of it is useless junk, the other half is a part of the query that most of the times does NOT contain the error.

How to repeat:
send a query with a syntax error

Suggested fix:
I know this error message is a beautiful piece of history:

"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 ..."

Then print it and expose it in a museum, but please remove it from current versions of the software that are meant to be (and actually are) used.

As a developer, this is one of the worst ways of reporting an error I've ever seen in a modern computer language.

* To start with, it's ridiculously long. "You have an error in your SQL syntax" can be reduced to "SQL Syntax error;"

* The part "Check the manual bla bla..... syntax to use" is completely useless and can be removed safely without loosing a bit of information.

* For god's sake at the very least replace "NEAR" with "JUST BEFORE"

* Explain what's wrong with the syntax. "Unexpected token '...'", or whatever.

One stares at the error message and half of it is useless junk, the other half is a part of the query that most of the times does NOT contain the error.
[15 Nov 2012 19:59] Sveta Smirnova
Thank you this impressive error report.

This is duplicate of bug #28466. Please subscribe to that bug to get updates about progress.
[15 Nov 2012 21:49] Jason Garrett
I agree completely.  Well put, and yes, long overdue to be resolved.
Simple, but very effective.