Combine query support doesn't repoint nested external references
    
    
    
      
      
      
        
As I came to discover trying to help someone on the forum the support for correlated subqueries (aka OuterRef) in combined queries (union, intersection, difference) added in #29338 fails to re-point external references on relabeling (an operation performed on subquery pushdown to prevent table name collisions) causing nested outer query references to be orphaned.
       
     
   
 
      
        
        
          Change History
          (6)
        
          
          
  
  
  
    
      | Description: | 
      
        modified (diff)
       | 
    
    
      | Summary: | 
      
        Composite query support doesn't report nested correlated queries external references → Combine query support doesn't repoint nested external references
       | 
    
  
 
           
          
  
  
  
    
      | Triage Stage: | 
      
        Unreviewed → Accepted
       | 
    
  
 
           
          
  
  
  
    
      | Owner: | 
      
        set to Simon Charette
       | 
    
  
 
           
          
  
  
  
    
      | Triage Stage: | 
      
        Accepted → Ready for checkin
       | 
    
  
 
           
          
  
  
  
    
      | Resolution: | 
      
        → fixed
       | 
    
    
      | Status: | 
      
        assigned → closed
       | 
    
  
 
           
          
         
       
     
        
    
    
In 53ea4cce: