Skip to content

Commit 400676a

Browse files
author
Thomas G. Lockhart
committed
Allow CASE statement to contain *only* untyped result clauses or nulls.
Almost worked before, but forgot one place to check. Reported by Tatsuo Ishii. Still does not do the right thing if inserting into a non-string target column. Should look for a type coersion later, but doesn't.
1 parent e86054e commit 400676a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/parser/parse_expr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.50 1999/07/11 02:04:19 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.50.2.1 1999/09/13 04:21:21 thomas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -467,7 +467,8 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
467467
* only bother with conversion if not NULL and
468468
* different type...
469469
*/
470-
if (wtype && (wtype != ptype))
470+
if (wtype && (wtype != UNKNOWNOID)
471+
&& (wtype != ptype))
471472
{
472473
if (can_coerce_type(1, &wtype, &ptype))
473474
{

0 commit comments

Comments
 (0)