postgresql/src
Tom Lane e7dcfd05f3 Apply Tcl_Init() to the "hold" interpreter created by pltcl.
You might think this is unnecessary since that interpreter is never used
to 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 by
loaded-on-demand Tcl code, which means that it fails if there's not
unknown-command support, and also that it's impossible to run it directly
in a safe interpreter.  The way they get around the latter is that
Tcl_CreateSlave() automatically sets up an alias command that forwards any
execution of "clock" in a safe slave interpreter to its parent interpreter.
Thus, when attempting to execute "clock" in trusted pltcl, the command
actually executes in the "hold" interpreter, where it will fail if
unknown-command support hasn't been introduced by sourcing the standard
init.tcl script, which is done by Tcl_Init().  (This is a pretty dubious
design 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 ancient
versions 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 regression
test support for pltcl.

Per recent trouble report from Kyle Bateman.
2010-01-25 01:58:14 +00:00
..
backend Fix assorted core dumps and Assert failures that could occur during 2010-01-24 21:49:17 +00:00
bin Replace ALTER TABLE ... SET STATISTICS DISTINCT with a more general mechanism. 2010-01-22 16:40:19 +00:00
include In HS, Startup process sets SIGALRM when waiting for buffer pin. If 2010-01-23 16:37:12 +00:00
interfaces Make argument const char * as per Takahiro Itagaki's suggestion. 2010-01-22 14:19:27 +00:00
makefiles Adjust windows makefiles too, now that the walreceiver dynamic module 2010-01-20 09:30:07 +00:00
pl Apply Tcl_Init() to the "hold" interpreter created by pltcl. 2010-01-25 01:58:14 +00:00
port Simplify validate_exec() by using access(2) to check file permissions, 2010-01-14 00:14:06 +00:00
template Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running 2009-02-11 20:02:40 +00:00
test Adjust psql to use pg_get_triggerdef(pretty=true) to remove extra ()'s 2010-01-21 06:11:46 +00:00
timezone Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
tools Adjust MSVC build script too, now that the walreceiver dynamic module 2010-01-20 09:22:43 +00:00
tutorial Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Rethink the way walreceiver is linked into the backend. Instead than shoving 2010-01-20 09:16:24 +00:00
Makefile.global.in Python 3 support in PL/Python 2009-12-15 22:59:55 +00:00
Makefile.shlib Derived files that are shipped in the distribution used to be built in the 2009-08-28 20:26:19 +00:00
nls-global.mk Update of install-sh, mkinstalldirs, and associated configury 2009-08-26 22:24:44 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00