• Tom Lane's avatar
    Fix grammar's AND/OR flattening to work with operator_precedence_warning. · 05104f69
    Tom Lane authored
    It'd be good for "(x AND y) AND z" to produce a three-child AND node
    whether or not operator_precedence_warning is on, but that failed to
    happen when it's on because makeAndExpr() didn't look through the added
    AEXPR_PAREN node.  This has no effect on generated plans because prepqual.c
    would flatten the AND nest anyway; but it does affect the number of parens
    printed in ruleutils.c, for example.  I'd already fixed some similar
    hazards in parse_expr.c in commit abb16465, but didn't think to search
    gram.y for problems of this ilk.  Per gripe from Jean-Pierre Pelletier.
    
    Report: <fa0535ec6d6428cfec40c7e8a6d11156@mail.gmail.com>
    05104f69
gram.y 395 KB