Commit a232f30f authored by Tom Lane's avatar Tom Lane

Volatile-ize all five places where we expect a PG_TRY block to restore

old memory context in plpython.  Before only one of them was marked
volatile, but per report from Zdenek Kotala, some compilers do the
wrong thing here.
parent 858d1699
/********************************************************************** /**********************************************************************
* plpython.c - python as a procedural language for PostgreSQL * plpython.c - python as a procedural language for PostgreSQL
* *
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.137 2010/02/14 18:42:19 rhaas Exp $ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.138 2010/02/18 23:50:06 tgl Exp $
* *
********************************************************************* *********************************************************************
*/ */
...@@ -2763,7 +2763,7 @@ PLy_spi_prepare(PyObject *self, PyObject *args) ...@@ -2763,7 +2763,7 @@ PLy_spi_prepare(PyObject *self, PyObject *args)
PyObject *volatile optr = NULL; PyObject *volatile optr = NULL;
char *query; char *query;
void *tmpplan; void *tmpplan;
MemoryContext oldcontext; volatile MemoryContext oldcontext;
/* Can't execute more if we have an unhandled error */ /* Can't execute more if we have an unhandled error */
if (PLy_error_in_progress) if (PLy_error_in_progress)
...@@ -2934,7 +2934,7 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit) ...@@ -2934,7 +2934,7 @@ PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit)
int i, int i,
rv; rv;
PLyPlanObject *plan; PLyPlanObject *plan;
MemoryContext oldcontext; volatile MemoryContext oldcontext;
if (list != NULL) if (list != NULL)
{ {
...@@ -3081,7 +3081,7 @@ static PyObject * ...@@ -3081,7 +3081,7 @@ static PyObject *
PLy_spi_execute_query(char *query, long limit) PLy_spi_execute_query(char *query, long limit)
{ {
int rv; int rv;
MemoryContext oldcontext; volatile MemoryContext oldcontext;
oldcontext = CurrentMemoryContext; oldcontext = CurrentMemoryContext;
PG_TRY(); PG_TRY();
...@@ -3116,7 +3116,7 @@ static PyObject * ...@@ -3116,7 +3116,7 @@ static PyObject *
PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status) PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
{ {
PLyResultObject *result; PLyResultObject *result;
MemoryContext oldcontext; volatile MemoryContext oldcontext;
result = (PLyResultObject *) PLy_result_new(); result = (PLyResultObject *) PLy_result_new();
Py_DECREF(result->status); Py_DECREF(result->status);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment