Bug #26095 Simple selects not using any fields from the table throw an error (1064)
Submitted: 5 Feb 2007 19:23 Modified: 6 Feb 2007 9:02
Reporter: Daniel Katz Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S2 (Serious)
Version:1.2.9 rc OS:Windows (Windows XP)
Assigned to: Mike Lischke CPU Architecture:Any
Tags: 1064

[5 Feb 2007 19:23] Daniel Katz
Description:
Simple queries like "Select 'Y' from dual" will work since 'dual' isn't real,
but "Select 'Y' from member" or similar where the table name is an actual table will throw an error and the error relates to the primary key of the table.

Query: select 'Y' from member;
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 ' sku 'Y' from member' at line 1

Actual usage:
Select 'Y' from member where registration_email = 'aaa' and registration_datetime is not null

..  The syntax has previously worked.  Works from the command line and from within our code, just not in the query browser.

How to repeat:
select 'Y' from {known_table};

such as

Select 'Y' from member where registration_email = 'aaa' and registration_datetime is not null
[5 Feb 2007 20:36] MySQL Verification Team
Thank you for the bug report.

mysql> select 'Y' from tb where id =1;
+---+
| Y |
+---+
| Y |
+---+
1 row in set (0.03 sec)
[6 Feb 2007 9:02] Mike Lischke
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 bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html