forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitabed06f
committed
Remove incorrect Assert.
check_agglevels_and_constraints() asserted that if we find anaggregate function in an EXPR_KIND_FROM_SUBSELECT expression, theexpression must be in a LATERAL subquery. Alexander Lakhin found acase where that's not so: because of the odd scoping rules for NEW/OLDwithin a rule, a reference to NEW/OLD could cause an aggregate to beconsidered top-level even though it's in an unmarked sub-select.The error message that would be thrown seems sufficiently on-point,so just remove the Assert. (Hence, this is not a bug for productionbuilds.)This Assert was added by me in commiteaccfde (9.3 era). It lookslike I put it in to cross-check that the new logic for detectingmisplaced aggregates (using agglevelsup) caught the same cases that aprevious check on p_lateral_active did. So there might have been somerelated misbehavior beforeeaccfde ... but that's very ancienthistory by now, so I didn't dig any deeper.Per bug #18608 from Alexander Lakhin. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/18608-48de0717508ee429@postgresql.org1 parentd1d0fe1 commitabed06f
1 file changed
+0
-2
lines changedLines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
374 | 374 |
| |
375 | 375 |
| |
376 | 376 |
| |
377 |
| - | |
378 |
| - | |
379 | 377 |
| |
380 | 378 |
| |
381 | 379 |
| |
|
0 commit comments
Comments
(0)