forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb631d01
committed
Fix pl/tcl's handling of errors from Tcl_ListObjGetElements().
In a procedure or function returning tuple, we use that function toparse the Tcl script's result, which is supposed to be a Tcl list.If it isn't, you get an error. Commit26abb50 incautiouslysupposed that we could use throw_tcl_error() to report such an error.That doesn't actually work, because low-level functions likeTcl_ListObjGetElements() don't fill Tcl's errorInfo variable.The result is either a null-pointer-dereference crash or emissionof misleading context information describing the previous Tcl error.Back off to just reporting the interpreter's result string, andimprove throw_tcl_error()'s comment to explain when to use it.Also, although the similar code in pltcl_trigger_handler() avoidedthis mistake, it was using a fairly confusing wording of theerror message. Improve that while we're here.Per report from A. Kozhemyakin. Back-patch to all supportedbranches.Erik Wienhold and Tom LaneDiscussion:https://postgr.es/m/6a2a1c40-2b2c-4a33-8b72-243c0766fcda@postgrespro.ru1 parentcd2624f commitb631d01
3 files changed
+28
-2
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
66 | 66 |
| |
67 | 67 |
| |
68 | 68 |
| |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
69 | 77 |
| |
70 | 78 |
| |
71 | 79 |
| |
|
Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1026 | 1026 |
| |
1027 | 1027 |
| |
1028 | 1028 |
| |
1029 |
| - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1030 | 1033 |
| |
1031 | 1034 |
| |
1032 | 1035 |
| |
| |||
1292 | 1295 |
| |
1293 | 1296 |
| |
1294 | 1297 |
| |
1295 |
| - | |
| 1298 | + | |
1296 | 1299 |
| |
1297 | 1300 |
| |
1298 | 1301 |
| |
| |||
1355 | 1358 |
| |
1356 | 1359 |
| |
1357 | 1360 |
| |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1358 | 1365 |
| |
1359 | 1366 |
| |
1360 | 1367 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
74 | 85 |
| |
75 | 86 |
| |
76 | 87 |
| |
|
0 commit comments
Comments
(0)