forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commitbb45c64
committed
Support default arguments and named-argument notation for window functions.
These things didn't work because the planner omitted to do the necessarypreprocessing of a WindowFunc's argument list. Add the few dozen linesof code needed to handle that.Although this sounds like a feature addition, it's really a bug fix becausethe default-argument case was likely to crash previously, due to lack ofchecking of the number of supplied arguments in the built-in windowfunctions. It's not a security issue because there's no way for anon-superuser to create a window function definition with defaults thatrefers to a built-in C function, but nonetheless people might be annoyedthat it crashes rather than producing a useful error message. Soback-patch as far as the patch applies easily, which turns out to be 9.2.I'll put a band-aid in earlier versions as a separate patch.(Note that these features still don't work for aggregates, and fixing thatcase will be harder since we represent aggregate arg lists as target listsnot bare expression lists. There's no crash risk though because CREATEAGGREGATE doesn't accept defaults, and we reject named-argument notationwhen parsing an aggregate call.)1 parent5829082 commitbb45c64
File tree
6 files changed
+103
-15
lines changed- doc/src/sgml
- src
- backend
- optimizer/util
- parser
- utils/adt
- test/regress
- expected
- sql
6 files changed
+103
-15
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2533 | 2533 |
| |
2534 | 2534 |
| |
2535 | 2535 |
| |
2536 |
| - | |
2537 |
| - | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
2538 | 2539 |
| |
2539 | 2540 |
| |
2540 | 2541 |
| |
|
Lines changed: 50 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2251 | 2251 |
| |
2252 | 2252 |
| |
2253 | 2253 |
| |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
2254 | 2304 |
| |
2255 | 2305 |
| |
2256 | 2306 |
| |
|
Lines changed: 0 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
537 | 537 |
| |
538 | 538 |
| |
539 | 539 |
| |
540 |
| - | |
541 |
| - | |
542 |
| - | |
543 |
| - | |
544 |
| - | |
545 |
| - | |
546 |
| - | |
547 |
| - | |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 | 540 |
| |
552 | 541 |
| |
553 | 542 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7461 | 7461 |
| |
7462 | 7462 |
| |
7463 | 7463 |
| |
| 7464 | + | |
7464 | 7465 |
| |
7465 | 7466 |
| |
7466 | 7467 |
| |
7467 | 7468 |
| |
7468 | 7469 |
| |
7469 | 7470 |
| |
7470 | 7471 |
| |
| 7472 | + | |
7471 | 7473 |
| |
7472 | 7474 |
| |
7473 | 7475 |
| |
7474 | 7476 |
| |
7475 |
| - | |
| 7477 | + | |
| 7478 | + | |
7476 | 7479 |
| |
7477 | 7480 |
| |
7478 | 7481 |
| |
7479 | 7482 |
| |
7480 | 7483 |
| |
7481 | 7484 |
| |
7482 |
| - | |
| 7485 | + | |
7483 | 7486 |
| |
7484 | 7487 |
| |
7485 | 7488 |
| |
|
Lines changed: 35 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1035 | 1035 |
| |
1036 | 1036 |
| |
1037 | 1037 |
| |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + |
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
274 | 274 |
| |
275 | 275 |
| |
276 | 276 |
| |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + |
0 commit comments
Comments
(0)