Commit c82037e
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 8355897 commit c82037e
1 file changed
+16
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14512 | 14512 | | |
14513 | 14513 | | |
14514 | 14514 | | |
| 14515 | + | |
| 14516 | + | |
| 14517 | + | |
| 14518 | + | |
| 14519 | + | |
| 14520 | + | |
14515 | 14521 | | |
14516 | | - | |
| 14522 | + | |
14517 | 14523 | | |
14518 | | - | |
| 14524 | + | |
14519 | 14525 | | |
14520 | 14526 | | |
14521 | 14527 | | |
| |||
14529 | 14535 | | |
14530 | 14536 | | |
14531 | 14537 | | |
| 14538 | + | |
| 14539 | + | |
| 14540 | + | |
| 14541 | + | |
| 14542 | + | |
| 14543 | + | |
14532 | 14544 | | |
14533 | | - | |
| 14545 | + | |
14534 | 14546 | | |
14535 | | - | |
| 14547 | + | |
14536 | 14548 | | |
14537 | 14549 | | |
14538 | 14550 | | |
| |||
0 commit comments