forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0d30e48
committed
Fix unnecessary use of moving-aggregate mode with non-moving frame.
When a plain aggregate is used as a window function, and the windowframe start is specified as UNBOUNDED PRECEDING, the frame's headcannot move so we do not need to use moving-aggregate mode. The checkfor that was put into initialize_peragg(), failing to notice thatExecInitWindowAgg() calls that function before it's filled inwinstate->frameOptions. Since makeNode() would have zeroed the field,this didn't provoke uninitialized-value complaints, nor would theerroneous decision have resulted in more than a little inefficiency.Still, it's wrong, so move the initialization ofwinstate->frameOptions earlier to make it work properly.While here, also fix a thinko in a comment. Both errors crept in incommita9d9acb which introduced the moving-aggregate mode.Spotted by Vallimaharajan G. Back-patch to all supported branches.Discussion:https://postgr.es/m/18e7f2a5167.fe36253866818.977923893562469143@zohocorp.com1 parent66bbad5 commit0d30e48
1 file changed
+4
-4
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2274 | 2274 |
| |
2275 | 2275 |
| |
2276 | 2276 |
| |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
2277 | 2280 |
| |
2278 | 2281 |
| |
2279 | 2282 |
| |
| |||
2501 | 2504 |
| |
2502 | 2505 |
| |
2503 | 2506 |
| |
2504 |
| - | |
2505 |
| - | |
2506 |
| - | |
2507 | 2507 |
| |
2508 | 2508 |
| |
2509 | 2509 |
| |
| |||
2654 | 2654 |
| |
2655 | 2655 |
| |
2656 | 2656 |
| |
2657 |
| - | |
| 2657 | + | |
2658 | 2658 |
| |
2659 | 2659 |
| |
2660 | 2660 |
| |
|
0 commit comments
Comments
(0)