Bug 163694

Summary: Parser issue with subqueries involving unions
Product: Red Hat Enterprise Linux 4 Reporter: Nick Stacey <redhat>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://bugs.mysql.com/bug.php?id=2435
Whiteboard:
Fixed In Version: RHSA-2005-685 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-05 12:45:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 156322    

Description Nick Stacey 2005-07-20 13:57:29 UTC
Description of problem:

There is a known issue with the supported version of mysql 4.1.10a. The parser 
mis-reads a query that has a union inside a subquery. This has been fixed in 
mysql 4.1.11. More information is contained on the official mysql site. 
http://bugs.mysql.com/bug.php?id=2435

Version-Release number of selected component (if applicable):

4.1.10a

How reproducible:

Every time.

Steps to Reproduce:

1. Feed the following query into mysql - 
CREATE TABLE t1 (a int not null, b char (10) not null); 
INSERT INTO t1 VALUES(1,'a'),(2,'b'),(3,'c'),(3,'c'); 
SELECT * FROM ((SELECT * FROM t1 LIMIT 1) UNION (SELECT * FROM t1 LIMIT 1)) a; 
  
Actual results:

Error - #1248 - Every derived table must have its own alias 

Expected results:

+---+---+
| a | b |
+---+---+
| 1 | a |
+---+---+
1 row in set (0.01 sec)

Additional info:

Comment 4 Tom Lane 2005-07-28 17:00:33 UTC
mysql 4.1.12 will be in RHEL4 U2.

Comment 5 Red Hat Bugzilla 2005-10-05 12:45:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-685.html