summaryrefslogtreecommitdiff
path: root/src/pl/plpython
diff options
context:
space:
mode:
Diffstat (limited to 'src/pl/plpython')
-rw-r--r--src/pl/plpython/feature.expected2
-rw-r--r--src/pl/plpython/plpython.c13
-rw-r--r--src/pl/plpython/plpython_schema.sql2
3 files changed, 14 insertions, 3 deletions
diff --git a/src/pl/plpython/feature.expected b/src/pl/plpython/feature.expected
index 9afd782e7d..b689c1f615 100644
--- a/src/pl/plpython/feature.expected
+++ b/src/pl/plpython/feature.expected
@@ -29,7 +29,7 @@ SELECT global_test_two();
(1 row)
SELECT import_fail();
-WARNING: ('import socket failed -- untrusted dynamic module: _socket',)
+NOTICE: ('import socket failed -- untrusted dynamic module: _socket',)
import_fail
--------------------
failed as expected
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 86f39cd4d0..005d85e9ce 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -29,7 +29,7 @@
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.24 2002/09/26 05:39:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.25 2002/10/14 04:20:52 momjian Exp $
*
*********************************************************************
*/
@@ -408,7 +408,9 @@ plpython_call_handler(PG_FUNCTION_ARGS)
else
PLy_restart_in_progress += 1;
if (proc)
+ {
Py_DECREF(proc->me);
+ }
RERAISE_EXC();
}
@@ -1841,7 +1843,14 @@ PLy_plan_dealloc(PyObject * arg)
*
* FIXME -- leaks saved plan on object destruction. can this be
* avoided?
+ * I think so. A function prepares and then execp's a statement.
+ * When we come to deallocate the 'statement' object we obviously
+ * no long need the plan. Even if we did, without the object
+ * we're never going to be able to use it again.
+ * In the against arguments: SPI_saveplan has stuck this under
+ * the top context so there must be a reason for doing that.
*/
+ pfree(ob->plan);
}
if (ob->types)
PLy_free(ob->types);
@@ -2374,6 +2383,8 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
PyList_SetItem(result->rows, i, row);
}
PLy_typeinfo_dealloc(&args);
+
+ SPI_freetuptable(tuptable);
}
RESTORE_EXC();
}
diff --git a/src/pl/plpython/plpython_schema.sql b/src/pl/plpython/plpython_schema.sql
index 28ceef5535..2f8766431f 100644
--- a/src/pl/plpython/plpython_schema.sql
+++ b/src/pl/plpython/plpython_schema.sql
@@ -20,7 +20,7 @@ CREATE TABLE taxonomy (
CREATE TABLE entry (
accession text not null primary key,
- eid serial,
+ eid serial unique,
txid int2 not null references taxonomy(id)
) ;