Fix a many-legged critter reported by chifungfan@yahoo.com: under the
Tom Lane <tgl@sss.pgh.pa.us>
Fix a many-legged critter reported by chifungfan@yahoo.com: under the right circumstances a hash join executed as a DECLARE CURSOR/FETCH query would crash the backend. Problem as seen in current sources was that the hash tables were stored in a context that was a child of TransactionCommandContext, which got zapped at completion of the FETCH command --- but cursor cleanup executed at COMMIT expected the tables to still be valid. I haven't chased down the details as seen in 7.0.* but I'm sure it's the same general problem.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/copy.c | modified | +3 −2 |
| src/backend/executor/execMain.c | modified | +25 −17 |
| src/backend/executor/execUtils.c | modified | +22 −13 |
| src/backend/executor/nodeHash.c | modified | +4 −3 |
| src/backend/tcop/pquery.c | modified | +20 −11 |
| src/include/executor/hashjoin.h | modified | +2 −2 |
| src/include/nodes/execnodes.h | modified | +8 −3 |