Thread

  1. subselects

    Bruce Momjian <maillist@candle.pha.pa.us> — 1998-01-20T22:18:54Z

    I have completed adding Var.varlevelsup, and have added code to the
    parser to properly set the field.  It will allow correlated references
    in the WHERE clause, but not in the target list.
    
    I did not make many changes in the optimizer or executor because I
    believed varlevelsup would be zero by the time it got to that point.
    For example, there are cases where the optimizer calls getrelid(Var *,
    RangeTable), and of course, because we don't have a parentQuery* in the
    Query, this will ignore the varlevelsup and only look in the current
    range table.
    
    I did make a few additions of varlevelsup in cases where they were
    checking for equality or copying Var records.  I made changes in all the
    support code, like /nodes handling.
    
    Let me know if you need additional changes.  makeVar takes a new
    varlevelsup parameter, and I made changes to all calls.
    
    I have tested the code, and debug output shows varlevelsup being set
    correctly.
    
    The only open item is how to do rewrite.  I will check into this later,
    probably in a week.  It will work by Feb 1.
    
    -- 
    Bruce Momjian
    maillist@candle.pha.pa.us