|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.83 2001/03/22 03:59:39 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.84 2001/03/27 17:12:34 tgl Exp $ |
12 | 12 | * |
13 | 13 | * HISTORY |
14 | 14 | * AUTHORDATEMAJOR EVENT |
@@ -939,7 +939,6 @@ is_single_func(Node *node) |
939 | 939 | * |
940 | 940 | * If the clause is not of the form (var op var) or if any of the vars |
941 | 941 | * refer to nested attributes, then zeroes are returned. |
942 | | - * |
943 | 942 | */ |
944 | 943 | void |
945 | 944 | get_rels_atts(Node*clause, |
@@ -1311,14 +1310,16 @@ eval_const_expressions_mutator(Node *node, void *context) |
1311 | 1310 | if (IsA(node,CaseExpr)) |
1312 | 1311 | { |
1313 | 1312 |
|
1314 | | -/* |
| 1313 | +/*---------- |
1315 | 1314 | * CASE expressions can be simplified if there are constant |
1316 | | - * condition clauses: FALSE (or NULL): drop the alternative TRUE: |
1317 | | - * drop all remaining alternatives If the first non-FALSE |
1318 | | - * alternative is a constant TRUE, we can simplify the entire CASE |
1319 | | - * to that alternative's expression. If there are no non-FALSE |
1320 | | - * alternatives, we simplify the entire CASE to the default result |
1321 | | - * (ELSE result). |
| 1315 | + * condition clauses: |
| 1316 | + *FALSE (or NULL): drop the alternative |
| 1317 | + *TRUE: drop all remaining alternatives |
| 1318 | + * If the first non-FALSE alternative is a constant TRUE, we can |
| 1319 | + * simplify the entire CASE to that alternative's expression. |
| 1320 | + * If there are no non-FALSE alternatives, we simplify the entire |
| 1321 | + * CASE to the default result (ELSE result). |
| 1322 | + *---------- |
1322 | 1323 | */ |
1323 | 1324 | CaseExpr*caseexpr= (CaseExpr*)node; |
1324 | 1325 | CaseExpr*newcase; |
|