forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite7dcfd0
committed
Apply Tcl_Init() to the "hold" interpreter created by pltcl.
You might think this is unnecessary since that interpreter is never usedto run code --- but it turns out that's wrong. As of Tcl 8.5, the "clock"command (alone among builtin Tcl commands) is partially implemented byloaded-on-demand Tcl code, which means that it fails if there's notunknown-command support, and also that it's impossible to run it directlyin a safe interpreter. The way they get around the latter is thatTcl_CreateSlave() automatically sets up an alias command that forwards anyexecution of "clock" in a safe slave interpreter to its parent interpreter.Thus, when attempting to execute "clock" in trusted pltcl, the commandactually executes in the "hold" interpreter, where it will fail ifunknown-command support hasn't been introduced by sourcing the standardinit.tcl script, which is done by Tcl_Init(). (This is a pretty dubiousdesign decision on the Tcl boys' part, if you ask me ... but they didn't.)Back-patch all the way. It's not clear that anyone would try to use ancientversions of pltcl with a recent Tcl, but it's not clear they wouldn't, either.Also add a regression test using "clock", in branches that have regressiontest support for pltcl.Per recent trouble report from Kyle Bateman.1 parent56cbb61 commite7dcfd0
File tree
3 files changed
+37
-2
lines changed- src/pl/tcl
- expected
- sql
3 files changed
+37
-2
lines changedLines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
495 | 495 |
| |
496 | 496 |
| |
497 | 497 |
| |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + |
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
| 5 | + | |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| |||
304 | 304 |
| |
305 | 305 |
| |
306 | 306 |
| |
| 307 | + | |
| 308 | + | |
307 | 309 |
| |
308 | 310 |
| |
309 |
| - | |
| 311 | + | |
| 312 | + | |
310 | 313 |
| |
311 | 314 |
| |
312 | 315 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
542 | 542 |
| |
543 | 543 |
| |
544 | 544 |
| |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + |
0 commit comments
Comments
(0)