aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execUtils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-03-17 20:48:43 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-03-17 20:48:43 +0000
commit55f7c3300d164d370d28b127210223d078da524d (patch)
treee5c91b7d50eef3b40dd395e3ecce877bb6663636 /src/backend/executor/execUtils.c
parent8c702ea7ace30026dfff4f2e514027cd4d6d7579 (diff)
downloadpostgresql-55f7c3300d164d370d28b127210223d078da524d.tar.gz
postgresql-55f7c3300d164d370d28b127210223d078da524d.zip
Reimplement CASE val WHEN compval1 THEN ... WHEN compval2 THEN ... END
so that the 'val' is computed only once, per recent discussion. The speedup is not much when 'val' is just a simple variable, but could be significant for larger expressions. More importantly this avoids issues with multiple evaluations of a volatile 'val', and it allows the CASE expression to be reverse-listed in its original form by ruleutils.c.
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r--src/backend/executor/execUtils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index b89f4015970..9702b1cf0aa 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.109 2004/01/22 02:23:21 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.110 2004/03/17 20:48:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -306,6 +306,9 @@ CreateExprContext(EState *estate)
econtext->ecxt_aggvalues = NULL;
econtext->ecxt_aggnulls = NULL;
+ econtext->caseValue_datum = (Datum) 0;
+ econtext->caseValue_isNull = true;
+
econtext->domainValue_datum = (Datum) 0;
econtext->domainValue_isNull = true;