postgresql/src
Tom Lane 8dcc675d88 Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan
is in progress on the same hashtable.  This seems the least invasive way to
fix the recently-recognized problem that a split could cause the scan to
visit entries twice or (with much lower probability) miss them entirely.
The only field-reported problem caused by this is the "failed to re-find
shared lock object" PANIC in COMMIT PREPARED reported by Michel Dorochevsky,
which was caused by multiply visited entries.  However, it seems certain
that mdsync() is vulnerable to missing required fsync's due to missed
entries, and I am fearful that RelationCacheInitializePhase2() might be at
risk as well.  Because of that and the generalized hazard presented by this
bug, back-patch all the supported branches.

Along the way, fix pg_prepared_statement() and pg_cursor() to not assume
that the hashtables they are examining will stay static between calls.
This is risky regardless of the newly noted dynahash problem, because
hash_seq_search() has never promised to cope with deletion of table entries
other than the just-returned one.  There may be no bug here because the only
supported way to call these functions is via ExecMakeTableFunctionResult()
which will cycle them to completion before doing anything very interesting,
but it seems best to get rid of the assumption.  This affects 8.2 and HEAD
only, since those functions weren't there earlier.
2007-04-26 23:25:41 +00:00
..
backend Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:25:41 +00:00
bin Don't write timing output in quiet mode. 2007-04-16 20:15:46 +00:00
corba Convert files from DOS format to normal text. 2000-12-03 14:43:59 +00:00
include Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:25:41 +00:00
interfaces Stamp releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19. 2007-04-19 03:06:37 +00:00
makefiles Use -Wl for linker switches on freebsd --- back-port of an 8.0 change. 2007-02-03 17:27:11 +00:00
pl Fix an ancient logic error in plpgsql's exec_stmt_block: it thought it could 2007-02-08 18:38:19 +00:00
port Add port support for unsetenv() in back branches. Needed for locale 2006-01-05 00:51:25 +00:00
template OK, another try at Darwin threads. 2004-07-08 18:25:22 +00:00
test Support explicit placement of the temporary-table schema within search_path. 2007-04-20 02:38:46 +00:00
tools Update release checklist to reflect that HISTORY and INSTALL don't 2005-05-08 23:34:32 +00:00
tutorial Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4, 2006-05-21 19:57:07 +00:00
utils Re-add Win32 missing files, I think. 2002-11-02 02:00:35 +00:00
bcc32.mak Attached is a patch to provide makefiles, etc. to allow the compilation 2002-12-30 21:07:26 +00:00
DEVELOPERS just testing a script... 1999-07-30 03:45:57 +00:00
Makefile Assorted fixes for Cygwin: 2002-09-05 18:28:46 +00:00
Makefile.global.in Supress ecpg thread test if configure didn't enable threads. Fix 2003-12-19 23:29:29 +00:00
Makefile.shlib Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX. 2005-12-03 20:17:00 +00:00
nls-global.mk Run distprep target before creating list of files that contain translatable 2003-09-14 22:40:38 +00:00
win32.mak Remove all traces of multibyte and locale options. Clean up comments 2002-09-03 21:45:44 +00:00