mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
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.
This commit is contained in:
parent
d786916015
commit
8005df3c20
@ -29,7 +29,7 @@
|
||||
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.66.2.7 2009/11/03 08:12:46 petere Exp $
|
||||
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.66.2.8 2010/02/18 23:50:33 tgl Exp $
|
||||
*
|
||||
*********************************************************************
|
||||
*/
|
||||
@ -1853,7 +1853,7 @@ PLy_spi_prepare(PyObject * self, PyObject * args)
|
||||
PyObject *volatile optr = NULL;
|
||||
char *query;
|
||||
void *tmpplan;
|
||||
MemoryContext oldcontext;
|
||||
volatile MemoryContext oldcontext;
|
||||
|
||||
/* Can't execute more if we have an unhandled error */
|
||||
if (PLy_error_in_progress)
|
||||
@ -2006,7 +2006,7 @@ PLy_spi_execute_plan(PyObject * ob, PyObject * list, long limit)
|
||||
int i,
|
||||
rv;
|
||||
PLyPlanObject *plan;
|
||||
MemoryContext oldcontext;
|
||||
volatile MemoryContext oldcontext;
|
||||
|
||||
if (list != NULL)
|
||||
{
|
||||
@ -2150,7 +2150,7 @@ static PyObject *
|
||||
PLy_spi_execute_query(char *query, long limit)
|
||||
{
|
||||
int rv;
|
||||
MemoryContext oldcontext;
|
||||
volatile MemoryContext oldcontext;
|
||||
|
||||
oldcontext = CurrentMemoryContext;
|
||||
PG_TRY();
|
||||
@ -2187,7 +2187,7 @@ static PyObject *
|
||||
PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
|
||||
{
|
||||
PLyResultObject *result;
|
||||
MemoryContext oldcontext;
|
||||
volatile MemoryContext oldcontext;
|
||||
|
||||
result = (PLyResultObject *) PLy_result_new();
|
||||
Py_DECREF(result->status);
|
||||
|
Loading…
Reference in New Issue
Block a user