|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.136 2003/07/28 00:09:14 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.137 2003/07/30 19:02:18 tgl Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -1603,6 +1603,10 @@ ExecEvalCase(CaseExprState *caseExpr, ExprContext *econtext, |
1603 | 1603 |
|
1604 | 1604 | /* ---------------------------------------------------------------- |
1605 | 1605 | *ExecEvalArray - ARRAY[] expressions |
| 1606 | + * |
| 1607 | + * NOTE: currently, if any input value is NULL then we return a NULL array, |
| 1608 | + * so the ARRAY[] construct can be considered strict. Eventually this will |
| 1609 | + * change; when it does, be sure to fix contain_nonstrict_functions(). |
1606 | 1610 | * ---------------------------------------------------------------- |
1607 | 1611 | */ |
1608 | 1612 | staticDatum |
@@ -1642,9 +1646,10 @@ ExecEvalArray(ArrayExprState *astate, ExprContext *econtext, |
1642 | 1646 |
|
1643 | 1647 | dvalues[i++]=ExecEvalExpr(e,econtext,&eisnull,NULL); |
1644 | 1648 | if (eisnull) |
1645 | | -ereport(ERROR, |
1646 | | -(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), |
1647 | | -errmsg("arrays cannot have NULL elements"))); |
| 1649 | +{ |
| 1650 | +*isNull= true; |
| 1651 | +return (Datum)0; |
| 1652 | +} |
1648 | 1653 | } |
1649 | 1654 |
|
1650 | 1655 | /* setup for 1-D array of the given length */ |
@@ -1686,9 +1691,10 @@ ExecEvalArray(ArrayExprState *astate, ExprContext *econtext, |
1686 | 1691 |
|
1687 | 1692 | arraydatum=ExecEvalExpr(e,econtext,&eisnull,NULL); |
1688 | 1693 | if (eisnull) |
1689 | | -ereport(ERROR, |
1690 | | -(errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), |
1691 | | -errmsg("arrays cannot have NULL elements"))); |
| 1694 | +{ |
| 1695 | +*isNull= true; |
| 1696 | +return (Datum)0; |
| 1697 | +} |
1692 | 1698 |
|
1693 | 1699 | array=DatumGetArrayTypeP(arraydatum); |
1694 | 1700 |
|
|