mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Remove ARRAY_PATCH define
This commit is contained in:
parent
e43dfad289
commit
8edbc3bde4
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.9 1996/10/31 05:54:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.10 1996/11/04 04:19:41 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1309,7 +1309,6 @@ 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);
|
||||
@ -1318,7 +1317,6 @@ make_targetlist_expr(ParseState *pstate,
|
||||
get_id_type((long)typelem),
|
||||
attrlen);
|
||||
} else
|
||||
#endif
|
||||
expr = (Node*)parser_typecast2(expr,
|
||||
type_id,
|
||||
get_id_type((long)attrtype),
|
||||
@ -1345,11 +1343,7 @@ 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
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.6 1996/11/04 04:05:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.7 1996/11/04 04:19:49 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -890,11 +890,7 @@ array_set(ArrayType *array,
|
||||
* fixed length arrays -- these are assumed to be 1-d
|
||||
*/
|
||||
if (indx[0]*elmlen > arraylen)
|
||||
#ifdef ARRAY_PATCH
|
||||
elog(WARN, "array_ref: array bound exceeded");
|
||||
#else
|
||||
elog(WARN, "array_set: array bound exceeded");
|
||||
#endif
|
||||
pos = (char *)array + indx[0]*elmlen;
|
||||
ArrayCastAndSet(dataPtr, (bool) reftype, elmlen, pos);
|
||||
return((char *)array);
|
||||
@ -905,14 +901,10 @@ array_set(ArrayType *array,
|
||||
nbytes = (* (int32 *) array) - ARR_OVERHEAD(ndim);
|
||||
|
||||
if (!SanityCheckInput(ndim, n, dim, lb, indx))
|
||||
#ifdef ARRAY_PATCH
|
||||
{
|
||||
elog(WARN, "array_set: array bound exceeded");
|
||||
return((char *)array);
|
||||
}
|
||||
#else
|
||||
return((char *)array);
|
||||
#endif
|
||||
offset = GetOffset( n, dim, lb, indx);
|
||||
|
||||
if (ARR_IS_LO(array)) {
|
||||
@ -948,7 +940,6 @@ array_set(ArrayType *array,
|
||||
if (nbytes - offset < 1) return((char *)array);
|
||||
pos = ARR_DATA_PTR (array) + offset;
|
||||
} else {
|
||||
#ifdef ARRAY_PATCH
|
||||
ArrayType *newarray;
|
||||
char *elt_ptr;
|
||||
int oldsize, newsize, oldlen, newlen, lth0, lth1, lth2;
|
||||
@ -980,9 +971,6 @@ array_set(ArrayType *array,
|
||||
|
||||
/* ??? who should free this storage ??? */
|
||||
return((char *)newarray);
|
||||
#else
|
||||
elog(WARN, "array_set: update of variable length fields not supported");
|
||||
#endif
|
||||
}
|
||||
ArrayCastAndSet(dataPtr, (bool) reftype, elmlen, pos);
|
||||
return((char *)array);
|
||||
|
@ -180,7 +180,6 @@
|
||||
|
||||
/* found in src/backend/utils/adt/arrayfuncs.c */
|
||||
/* #define LOARRAY */
|
||||
#define ARRAY_PATCH
|
||||
#define NULL_PATCH
|
||||
#define OPENLINK_PATCHES
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user