Bug #762 problem with name resolving in subqueries of glodal ORDER BY of UNION
Submitted: 30 Jun 2003 8:33 Modified: 20 Aug 2003 10:31
Reporter: Oleksandr Byelkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1 OS:
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[30 Jun 2003 8:33] Oleksandr Byelkin
Description:
outer fields of names of subqueries of glodal ORDER BY of UNION 

How to repeat:
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a)
[30 Jun 2003 8:37] Oleksandr Byelkin
It suspended until IN optimization patch will be reviewed
[3 Jul 2003 1:42] Oleksandr Byelkin
ChangeSet 
  1.1550 03/07/03 02:30:52 bell@sanja.is.com.ua +11 -0 
  (SCRUM) 
  It looks like samll revolution in SELECT_LEX tree, but it was only natural 
way to solve problem with name resolution of 
+external fields inside subselect which belongs to global order of union 
  also it have following advantages: 
   - removed mess with current_select type conversion 
     - type checking/converting                       
     - a lot of virtual methods 
   - fake select for union execution allocated only once (it was allocated for 
every subselect with union executing) 
 
  changes: 
  fixed bug with outer fields name resolution of subqueries which belong to 
global ORDER BY clause 
  remuved select_lex() function, now thd->lex.current_select always have type 
SELECT_LEX 
  new SELECT_LEX (fake_select_lex) will be allocated in case of UNION for 
using in UNION processing 
  fake_select_lex allocated for union hold global ORDER BY & LIMIT clauses and 
have linkage equal to GLOBAL_OPTIONS_TYPE 
  new description of SELECT_LEX tree