diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-22 04:06:22 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-08-22 04:06:22 +0000 |
commit | 0147b1934f251183d3614bca011bf21205890835 (patch) | |
tree | ed7df11ba0ecbdae22095a2eeacbd204dcdca1b8 /src/backend/commands/copy.c | |
parent | 94e90d9a86a186c83891fe4ce3e343bcf1860053 (diff) | |
download | postgresql-0147b1934f251183d3614bca011bf21205890835.tar.gz postgresql-0147b1934f251183d3614bca011bf21205890835.zip |
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.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index c71d0818098..4b81a35c122 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.120 2000/08/06 04:26:40 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.121 2000/08/22 04:06:21 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,7 @@ #include "executor/executor.h" #include "libpq/libpq.h" #include "miscadmin.h" +#include "tcop/pquery.h" #include "tcop/tcopprot.h" #include "utils/acl.h" #include "utils/builtins.h" @@ -598,7 +599,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, tuples_read = 0; bool reading_to_eof = true; RelationInfo *relationInfo; - EState *estate = makeNode(EState); /* for ExecConstraints() */ + EState *estate = CreateExecutorState(); /* for ExecConstraints() */ TupleTable tupleTable; TupleTableSlot *slot; Oid loaded_oid = InvalidOid; |