From f698b962f1112b26d549f6debde35f60f41a1fa4 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 27 Feb 2009 10:27:33 +0000 Subject: [PATCH] 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 07d25b6e95..e8440b3b00 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -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; } } -- 2.39.5