forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit77761ee
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 parent2804233 commit77761ee
1 file changed
+0
-2
lines changedLines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
381 | 381 |
| |
382 | 382 |
| |
383 | 383 |
| |
384 |
| - | |
385 |
| - | |
386 | 384 |
| |
387 | 385 |
| |
388 | 386 |
| |
|
0 commit comments
Comments
(0)