aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-02-27 10:27:53 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-02-27 10:27:53 +0000
commit1a5b7b0b57cd02e9b6aae5e46cb8f18ace7561bc (patch)
tree35537a49c705b8673477be64b740beb110bd11ad
parentf970cc9588fc0fe43c61f03e5fd4bd30f3d4d786 (diff)
downloadpostgresql-1a5b7b0b57cd02e9b6aae5e46cb8f18ace7561bc.tar.gz
postgresql-1a5b7b0b57cd02e9b6aae5e46cb8f18ace7561bc.zip
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.
-rw-r--r--src/pl/plpgsql/src/pl_exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index a3e87674492..4744097b2be 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.154.2.7 2008/09/01 22:30:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.154.2.8 2009/02/27 10:27:53 heikki Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -953,8 +953,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;
}
}