7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.35 2000/01/15 02:59:32 petere Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.36 2000/01/17 02:04:16 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -319,8 +319,8 @@ transformArraySubscripts(ParseState *pstate,
319
319
{
320
320
subexpr = transformExpr (pstate ,ai -> lidx ,EXPR_COLUMN_FIRST );
321
321
/* If it's not int4 already, try to coerce */
322
- subexpr = CoerceTargetExpr (pstate ,subexpr ,
323
- exprType ( subexpr ), INT4OID );
322
+ subexpr = CoerceTargetExpr (pstate ,subexpr ,exprType ( subexpr ),
323
+ INT4OID , -1 );
324
324
if (subexpr == NULL )
325
325
elog (ERROR ,"array index expressions must be integers" );
326
326
}
@@ -339,8 +339,8 @@ transformArraySubscripts(ParseState *pstate,
339
339
}
340
340
subexpr = transformExpr (pstate ,ai -> uidx ,EXPR_COLUMN_FIRST );
341
341
/* If it's not int4 already, try to coerce */
342
- subexpr = CoerceTargetExpr (pstate ,subexpr ,
343
- exprType ( subexpr ), INT4OID );
342
+ subexpr = CoerceTargetExpr (pstate ,subexpr ,exprType ( subexpr ),
343
+ INT4OID , -1 );
344
344
if (subexpr == NULL )
345
345
elog (ERROR ,"array index expressions must be integers" );
346
346
upperIndexpr = lappend (upperIndexpr ,subexpr );
@@ -358,8 +358,10 @@ transformArraySubscripts(ParseState *pstate,
358
358
{
359
359
if (typesource != typeneeded )
360
360
{
361
+ /* XXX fixme: need to get the array's atttypmod? */
361
362
assignFrom = CoerceTargetExpr (pstate ,assignFrom ,
362
- typesource ,typeneeded );
363
+ typesource ,typeneeded ,
364
+ -1 );
363
365
if (assignFrom == NULL )
364
366
elog (ERROR ,"Array assignment requires type '%s'"
365
367
" but expression is of type '%s'"