diff options
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r-- | src/backend/parser/analyze.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index 3f44037ca74..cba2e211994 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.2 1996/07/19 07:24:06 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.3 1996/07/20 07:58:04 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -1386,6 +1386,16 @@ make_targetlist_expr(ParseState *pstate, if (attrtype != type_id) { if (IsA(expr,Const)) { /* try to cast the constant */ +#ifdef ARRAY_PATCH + if (arrayRef && !(((A_Indices *)lfirst(arrayRef))->lidx)) { + /* updating a single item */ + Oid typelem = get_typelem(attrtype); + expr = (Node*)parser_typecast2(expr, + type_id, + get_id_type((long)typelem), + attrlen); + } else +#endif expr = (Node*)parser_typecast2(expr, type_id, get_id_type((long)attrtype), @@ -1418,7 +1428,11 @@ make_targetlist_expr(ParseState *pstate, &pstate->p_last_resno); while(ar!=NIL) { A_Indices *ind = lfirst(ar); +#ifdef ARRAY_PATCH + if (lowerIndexpr || (!upperIndexpr && ind->lidx)) { +#else if (lowerIndexpr) { +#endif /* XXX assume all lowerIndexpr is non-null in * this case */ |