|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.37 1998/12/04 15:34:30 thomas Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.38 1998/12/13 23:56:43 thomas Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -251,8 +251,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
251 | 251 | {
|
252 | 252 |
|
253 | 253 | /*
|
254 |
| - * look for a column name or a relation name (the default |
255 |
| - * behavior) |
| 254 | + * look for a column name or a relation name (the default behavior) |
256 | 255 | */
|
257 | 256 | result = transformIdent(pstate, expr, precedence);
|
258 | 257 | break;
|
@@ -358,13 +357,6 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
358 | 357 | w->expr = (Node *)a;
|
359 | 358 | }
|
360 | 359 | lfirst(args) = transformExpr(pstate, (Node *) w, precedence);
|
361 |
| - |
362 |
| - if (w->result == NULL) |
363 |
| - { |
364 |
| - A_Const *n = makeNode(A_Const); |
365 |
| - n->val.type = T_Null; |
366 |
| - w->result = (Node *)n; |
367 |
| - } |
368 | 360 | }
|
369 | 361 |
|
370 | 362 | if (c->defresult == NULL)
|
@@ -413,7 +405,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
413 | 405 | }
|
414 | 406 | }
|
415 | 407 |
|
416 |
| - /* Convert default clause, if necessary */ |
| 408 | + /* Convert default result clause, if necessary */ |
417 | 409 | if (c->casetype != ptype)
|
418 | 410 | {
|
419 | 411 | if (! c->casetype)
|
@@ -469,8 +461,13 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
469 | 461 | elog(ERROR,"WHEN clause must have a boolean result");
|
470 | 462 |
|
471 | 463 | /* result is NULL for NULLIF() construct - thomas 1998-11-11 */
|
472 |
| - if (w->result != NULL) |
473 |
| - w->result = transformExpr(pstate, (Node *) w->result, precedence); |
| 464 | + if (w->result == NULL) |
| 465 | + { |
| 466 | + A_Const *n = makeNode(A_Const); |
| 467 | + n->val.type = T_Null; |
| 468 | + w->result = (Node *)n; |
| 469 | + } |
| 470 | + w->result = transformExpr(pstate, (Node *) w->result, precedence); |
474 | 471 | result = expr;
|
475 | 472 | break;
|
476 | 473 | }
|
|
0 commit comments