forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfd2664d
committed
Rationalize and document pltcl's handling of magic ".tupno" array element.
For a very long time, pltcl's spi_exec and spi_execp commands have hada behavior of storing the current row number as an element of outputarrays, but this was never documented. Fix that.For an equally long time, pltcl_trigger_handler had a behavior of silentlyignoring ".tupno" as an output column name, evidently so that the resultof spi_exec could be used directly as a trigger result tuple. Not surehow useful that really is, but in any case it's bad that it would breakattempts to use ".tupno" as an actual column name. We can fix it by notchecking for ".tupno" until after we check for a column name match. Thiscomports with the effective behavior of spi_exec[p] that ".tupno" is onlymagic when you don't have an actual column named that.In passing, wordsmith the description of returning modified tuples froma pltcl trigger.Noted while working on Jim Nasby's patch to support composite resultsfrom pltcl. The inability to return trigger tuples using ".tupno" asa column name is a bug, so back-patch to all supported branches.1 parentfc8b81a commitfd2664d
2 files changed
+50
-27
lines changedLines changed: 35 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
299 |
| - | |
300 |
| - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
301 | 304 |
| |
302 | 305 |
| |
303 | 306 |
| |
304 | 307 |
| |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
309 | 312 |
| |
310 | 313 |
| |
311 | 314 |
| |
312 |
| - | |
313 | 315 |
| |
314 | 316 |
| |
315 | 317 |
| |
316 | 318 |
| |
317 | 319 |
| |
318 | 320 |
| |
319 | 321 |
| |
320 |
| - | |
321 |
| - | |
322 |
| - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
323 | 326 |
| |
324 | 327 |
| |
325 | 328 |
| |
326 | 329 |
| |
327 | 330 |
| |
328 |
| - | |
329 | 331 |
| |
330 | 332 |
| |
331 | 333 |
| |
| |||
667 | 669 |
| |
668 | 670 |
| |
669 | 671 |
| |
670 |
| - | |
671 |
| - | |
672 |
| - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
673 | 676 |
| |
674 | 677 |
| |
675 |
| - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
676 | 682 |
| |
677 |
| - | |
| 683 | + | |
678 | 684 |
| |
679 | 685 |
| |
680 |
| - | |
681 |
| - | |
682 |
| - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
683 | 692 |
| |
684 | 693 |
| |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
685 | 701 |
| |
686 | 702 |
| |
687 | 703 |
| |
|
Lines changed: 15 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1118 | 1118 |
| |
1119 | 1119 |
| |
1120 | 1120 |
| |
1121 |
| - | |
1122 |
| - | |
1123 |
| - | |
1124 |
| - | |
1125 |
| - | |
1126 |
| - | |
1127 | 1121 |
| |
1128 | 1122 |
| |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1129 | 1127 |
| |
1130 | 1128 |
| |
1131 | 1129 |
| |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1132 | 1133 |
| |
1133 | 1134 |
| |
1134 | 1135 |
| |
1135 | 1136 |
| |
| 1137 | + | |
1136 | 1138 |
| |
1137 | 1139 |
| |
1138 | 1140 |
| |
| |||
2703 | 2705 |
| |
2704 | 2706 |
| |
2705 | 2707 |
| |
2706 |
| - | |
2707 |
| - | |
| 2708 | + | |
2708 | 2709 |
| |
2709 | 2710 |
| |
2710 | 2711 |
| |
| |||
2715 | 2716 |
| |
2716 | 2717 |
| |
2717 | 2718 |
| |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
2718 | 2725 |
| |
2719 | 2726 |
| |
2720 | 2727 |
| |
|
0 commit comments
Comments
(0)