diff options
| author | Tom Lane | 2004-03-17 20:48:43 +0000 |
|---|---|---|
| committer | Tom Lane | 2004-03-17 20:48:43 +0000 |
| commit | 55f7c3300d164d370d28b127210223d078da524d (patch) | |
| tree | e5c91b7d50eef3b40dd395e3ecce877bb6663636 /src/pl | |
| parent | 8c702ea7ace30026dfff4f2e514027cd4d6d7579 (diff) | |
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/pl')
| -rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 0c409c0e64e..b984f0932bb 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.97 2004/02/25 18:10:51 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.98 2004/03/17 20:48:43 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -3729,6 +3729,9 @@ exec_simple_check_node(Node *node) return TRUE; } + case T_CaseTestExpr: + return TRUE; + case T_ArrayExpr: { ArrayExpr *expr = (ArrayExpr *) node; @@ -3770,6 +3773,9 @@ exec_simple_check_node(Node *node) case T_CoerceToDomain: return exec_simple_check_node((Node *) ((CoerceToDomain *) node)->arg); + case T_CoerceToDomainValue: + return TRUE; + case T_List: { List *expr = (List *) node; |
