Go to file
Tom Lane b1b2140035 Fix an old bug in after-trigger handling: AfterTriggerEndQuery took the
address of afterTriggers->query_stack[afterTriggers->query_depth] and hung
onto it through all its firings of triggers.  However, if a trigger causes
sufficiently many nested query executions, query_stack will get repalloc'd
bigger, leaving AfterTriggerEndQuery --- and hence afterTriggerInvokeEvents
--- using a stale pointer.

So far as I can find, the only consequence of this error is to stomp on a
couple of words of already-freed memory; which would lead to a failure only if
that chunk had already gotten re-allocated for something else.  So it's hard
to exhibit a simple failure case, but this is surely a bug.

I noticed this while working on my recent patch to reduce pending-trigger
space usage.  The present patch is mighty ugly, because it requires making
afterTriggerInvokeEvents know about all the possible event lists it might get
called on.  Fortunately, this is only needed in back branches because CVS HEAD
avoids the problem in a different way: afterTriggerInvokeEvents only touches
the passed AfterTriggerEventList pointer once at startup.  Back branches are
stable enough that wiring in knowledge of all possible call usages doesn't
seem like a killer problem.

Back-patch to 8.0.  7.4's trigger code is completely different and doesn't
seem to have the problem (it doesn't even use repalloc).
2008-10-25 03:33:05 +00:00
config New version of mkinstalldirs fixes problems on Tru64 UNIX. 2005-01-08 09:54:29 +00:00
contrib Fix small bug in headline generation. 2008-10-17 17:42:32 +00:00
doc tag for 8.0.18 2008-09-19 03:23:34 +00:00
src Fix an old bug in after-trigger handling: AfterTriggerEndQuery took the 2008-10-25 03:33:05 +00:00
aclocal.m4
configure tag for 8.0.18 2008-09-19 03:23:34 +00:00
configure.in tag for 8.0.18 2008-09-19 03:23:34 +00:00
COPYRIGHT Tag appropriate files for rc3 2004-12-31 22:04:05 +00:00
GNUmakefile.in Add installcheck-parallel target to top level makefiles. 2006-08-18 19:59:05 +00:00
Makefile Add installcheck-parallel target to top level makefiles. 2006-08-18 19:59:05 +00:00
README
README.CVS

PostgreSQL Database Management System
=====================================
  
This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions.  This distribution also contains C language bindings.

The JDBC, ODBC, C++, Python, and Tcl interfaces have been moved to the
PostgreSQL Projects Web Site at http://gborg.postgresql.org for separate
maintenance.  A Perl DBI/DBD driver is available from CPAN.

See the file INSTALL for instructions on how to build and install
PostgreSQL.  That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system.  Changes between all PostgreSQL releases are recorded in the
file HISTORY.  Copyright and license information can be found in the
file COPYRIGHT.  A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software may be obtained at
ftp://ftp.postgresql.org/pub/.  For more information look at our web
site located at http://www.postgresql.org/.