|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.103 2004/06/06 00:41:27 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.104 2004/06/08 20:28:21 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -1837,6 +1837,12 @@ array_set_slice(ArrayType *array,
|
1837 | 1837 | lb[i]=lowerIndx[i];
|
1838 | 1838 | }
|
1839 | 1839 |
|
| 1840 | +/* complain if too few source items; we ignore extras, however */ |
| 1841 | +if (nelems<ArrayGetNItems(nSubscripts,dim)) |
| 1842 | +ereport(ERROR, |
| 1843 | +(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), |
| 1844 | +errmsg("source array too small"))); |
| 1845 | + |
1840 | 1846 | returnconstruct_md_array(dvalues,nSubscripts,dim,lb,elmtype,
|
1841 | 1847 | elmlen,elmbyval,elmalign);
|
1842 | 1848 | }
|
|