Bug #1249 Bug in UNION statement with alias '*'
Submitted: 11 Sep 2003 7:34 Modified: 10 Dec 2003 15:09
Reporter: Indrek Siitan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0 OS:Any (any)
Assigned to: Sinisa Milivojevic CPU Architecture:Any

[11 Sep 2003 7:34] Indrek Siitan
Description:
When issuing a UNION query with a column having an alias starting with a '*' (star/asterisk) 
character, the database returns an error:
    ERROR 1051: Unknown table ''

How to repeat:
select version() as `*` UNION select user() as `anything`;
Notice that the '*' is properly quoted with inverse quotes. 
The simple statement 
SELECT version() AS `*`;
works fine. The error only shows up with UNION.
[10 Dec 2003 15:09] Michael Widenius
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

Additional info:

Fix will be in 4.0.17