Bug #12170 A Select query containing only a newline character beteen the "*" and "FROM" re
Submitted: 26 Jul 2005 5:54 Modified: 23 Aug 2005 10:08
Reporter: Espen Heien Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.13 OS:Windows (Windows XP SP2)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[26 Jul 2005 5:54] Espen Heien
Description:
A Select query containing only a newline character beteen the "*" and "FROM" results in an error.

SELECT *
FROM test

While "SELECT*FROM test" or "SELECT * FROM test" works as expected.

I also tested this in the command line client which seems to work as expected. (no errors).

How to repeat:
Create the following test table:
 
 CREATE TABLE `testing`.`test` (
   `firstname` VARCHAR(45) NOT NULL,
   `lastname` VARCHAR(45) NOT NULL,
   PRIMARY KEY(`firstname`)
 )
ENGINE = MYISAM;
 
And run the following query divided into two lines like this:
 
SELECT *
FROM test 

making sure no whitespaces other than the newline, "Enter/Return", key are between the "*" and "FROM".
 
And you will get the following error message:
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 ' firstname*
FROM test' at line 1

Suggested fix:
Recognise the "Enter" key as ordinary whitespace character.
[23 Aug 2005 10:08] Vladimir Kolesnikov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html