postgres.git / summary / log / commit / refs

commit    29d033f926f2c75e75599d5c51657baa5d2022a3
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Fri Feb 27 10:27:33 2009 +0000
First released in: 8.1.17, 8.2.13, 8.3.7

    Set isnull for errm and sqlstate local variables when they're free'd. Because
    they are out of scope for any code after that anyway, leaving isnull true
    should be harmless. However, PL/pgSQL Debugger doesn't seem to care about
    the scoping and crashed, per report by Robert Walker (bug #4635). And it's
    good to be tidy for debugging purposes too.
    
    Fix in 8.3, 8.2 and 8.1 branches, CVS HEAD was fixed earlier already.
    
    Analysis and fix by Ashesh Vashi and Dave Page.


src/pl/plpgsql/src/pl_exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 414c552ac3f..5ed58cd69eb 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.202.2.3 2009/01/14 09:53:54 heikki Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.202.2.4 2009/02/27 10:27:33 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -1088,8 +1088,10 @@ exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block) free_var(state_var); state_var->value = (Datum) 0; + state_var->isnull = true; free_var(errm_var); errm_var->value = (Datum) 0; + errm_var->isnull = true; break; } } [parent: 58a36a1ad761]