forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd727c54
committed
Fix recursive RECORD-returning plpython functions.
If we recursed to a new call of the same function, with a differentcoldeflist (AS clause), it would fail because the inner call wouldoverwrite the outer call's idea of what to return. This is vaguelylike1d2fe56 andc5bec54, but it's not due to any API decisions:it's just that we computed the actual output rowtype at the start ofthe call, and saved it in the per-procedure data structure. We canfix it at basically zero cost by doing the computation at the endof each call instead of the start.It's not clear that there's any real-world use-case for such afunction, but given that it doesn't cost anything to fix,it'd be silly not to.Per report from Andreas Karlsson. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/1651a46d-3c15-4028-a8c1-d74937b54e19@proxel.se1 parentb538e69 commitd727c54
File tree
3 files changed
+42
-16
lines changed- src/pl/plpython
- expected
- sql
3 files changed
+42
-16
lines changedLines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
569 | 569 |
| |
570 | 570 |
| |
571 | 571 |
| |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
572 | 586 |
| |
573 | 587 |
| |
574 | 588 |
| |
|
Lines changed: 17 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
231 | 231 |
| |
232 | 232 |
| |
233 | 233 |
| |
234 |
| - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
235 | 251 |
| |
236 | 252 |
| |
237 | 253 |
| |
| |||
456 | 472 |
| |
457 | 473 |
| |
458 | 474 |
| |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
465 |
| - | |
466 |
| - | |
467 |
| - | |
468 |
| - | |
469 |
| - | |
470 |
| - | |
471 |
| - | |
472 |
| - | |
473 |
| - | |
474 | 475 |
| |
475 | 476 |
| |
476 | 477 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
208 | 208 |
| |
209 | 209 |
| |
210 | 210 |
| |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
211 | 222 |
| |
212 | 223 |
| |
213 | 224 |
| |
|
0 commit comments
Comments
(0)