Commit 05104f6
committed
Fix grammar's AND/OR flattening to work with operator_precedence_warning.
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 abb1646, but didn't think to search
gram.y for problems of this ilk. Per gripe from Jean-Pierre Pelletier.
Report: <fa0535ec6d6428cfec40c7e8a6d11156@mail.gmail.com>1 parent d50183c commit 05104f6
1 file changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14643 | 14643 | | |
14644 | 14644 | | |
14645 | 14645 | | |
| 14646 | + | |
| 14647 | + | |
| 14648 | + | |
| 14649 | + | |
| 14650 | + | |
| 14651 | + | |
14646 | 14652 | | |
14647 | | - | |
| 14653 | + | |
14648 | 14654 | | |
14649 | | - | |
| 14655 | + | |
14650 | 14656 | | |
14651 | 14657 | | |
14652 | 14658 | | |
| |||
14660 | 14666 | | |
14661 | 14667 | | |
14662 | 14668 | | |
| 14669 | + | |
| 14670 | + | |
| 14671 | + | |
| 14672 | + | |
| 14673 | + | |
| 14674 | + | |
14663 | 14675 | | |
14664 | | - | |
| 14676 | + | |
14665 | 14677 | | |
14666 | | - | |
| 14678 | + | |
14667 | 14679 | | |
14668 | 14680 | | |
14669 | 14681 | | |
| |||
0 commit comments