Bug #34219 MySQL 5.0.18
Submitted: 1 Feb 2008 10:01 Modified: 1 Feb 2008 10:20
Reporter: ilie vinti Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version: OS:Windows
Assigned to: CPU Architecture:Any
Tags: table alias

[1 Feb 2008 10:01] ilie vinti
Description:
is ok: select * from (SELECT * from tableA union all select * from tableB) as w 
error: select * from (SELECT * from tableA union all select * from tableB) w 

(error appear if i don't use "as" for alias)

How to repeat:
??
[1 Feb 2008 10:20] Valeriy Kravchuk
Please, try to repeat with a newer version, 5.0.51a. Look:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -proot test -P3308
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.54-enterprise-gpl-nt-log MySQL Enterprise Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> desc t;
+-------+---------+------+-----+---------+-------+
| Field | Type    | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| a     | char(1) | YES  |     | NULL    |       |
| b     | char(1) | YES  |     | NULL    |       |
| c     | char(1) | YES  |     | NULL    |       |
+-------+---------+------+-----+---------+-------+
3 rows in set (0.14 sec)

mysql> select * from (select * from t union all select * from t) as w;
+------+------+------+
| a    | b    | c    |
+------+------+------+
| a    | a    | NULL |
| a    | a    | NULL |
+------+------+------+
2 rows in set (0.03 sec)

mysql> select * from (select * from t union all select * from t)  w;
+------+------+------+
| a    | b    | c    |
+------+------+------+
| a    | a    | NULL |
| a    | a    | NULL |
+------+------+------+
2 rows in set (0.00 sec)