forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1488dee
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 parentd0c11ea commit1488dee
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 | |
---|---|---|---|
| |||
1020 | 1020 |
| |
1021 | 1021 |
| |
1022 | 1022 |
| |
1023 |
| - | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1024 | 1027 |
| |
1025 | 1028 |
| |
1026 | 1029 |
| |
| |||
1287 | 1290 |
| |
1288 | 1291 |
| |
1289 | 1292 |
| |
1290 |
| - | |
| 1293 | + | |
1291 | 1294 |
| |
1292 | 1295 |
| |
1293 | 1296 |
| |
| |||
1350 | 1353 |
| |
1351 | 1354 |
| |
1352 | 1355 |
| |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1353 | 1360 |
| |
1354 | 1361 |
| |
1355 | 1362 |
| |
|
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)