forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdda633a
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 parent1d5c5ae commitdda633a
3 files changed
+28
-2
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 |
| |
53 | 61 |
| |
54 | 62 |
| |
|
Lines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1022 | 1022 |
| |
1023 | 1023 |
| |
1024 | 1024 |
| |
1025 |
| - | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1026 | 1029 |
| |
1027 | 1030 |
| |
1028 | 1031 |
| |
| |||
1289 | 1292 |
| |
1290 | 1293 |
| |
1291 | 1294 |
| |
1292 |
| - | |
| 1295 | + | |
1293 | 1296 |
| |
1294 | 1297 |
| |
1295 | 1298 |
| |
| |||
1352 | 1355 |
| |
1353 | 1356 |
| |
1354 | 1357 |
| |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
1355 | 1362 |
| |
1356 | 1363 |
| |
1357 | 1364 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
55 | 66 |
| |
56 | 67 |
| |
57 | 68 |
| |
|
0 commit comments
Comments
(0)