summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-02-27 10:27:45 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2009-02-27 10:27:45 +0000
commitfaa0b6043bda6e913ae7f12fc1700f36633b642d (patch)
tree7dd26bb5374a8192d07a5a942ba5a636bb4c1cb4 /src
parentd3247aefea14e1924710e6a1410dd14faffcbf9f (diff)
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.
Diffstat (limited to 'src')
-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 0599f1de8aa..074379fd78a 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.180.2.8 2009/01/14 09:53:57 heikki Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.180.2.9 2009/02/27 10:27:45 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1046,8 +1046,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;
}
}