mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Remove 'Array' node type, which has evidently been dead code for
a very long time.
This commit is contained in:
@ -19,7 +19,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.117 2000/07/17 03:04:58 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.118 2000/07/22 04:22:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -933,26 +933,6 @@ _copyCaseWhen(CaseWhen *from)
|
|||||||
return newnode;
|
return newnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Array *
|
|
||||||
_copyArray(Array *from)
|
|
||||||
{
|
|
||||||
Array *newnode = makeNode(Array);
|
|
||||||
|
|
||||||
/* ----------------
|
|
||||||
* copy remainder of node
|
|
||||||
* ----------------
|
|
||||||
*/
|
|
||||||
newnode->arrayelemtype = from->arrayelemtype;
|
|
||||||
newnode->arrayelemlength = from->arrayelemlength;
|
|
||||||
newnode->arrayelembyval = from->arrayelembyval;
|
|
||||||
newnode->arrayndim = from->arrayndim;
|
|
||||||
newnode->arraylow = from->arraylow;
|
|
||||||
newnode->arrayhigh = from->arrayhigh;
|
|
||||||
newnode->arraylen = from->arraylen;
|
|
||||||
|
|
||||||
return newnode;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ArrayRef *
|
static ArrayRef *
|
||||||
_copyArrayRef(ArrayRef *from)
|
_copyArrayRef(ArrayRef *from)
|
||||||
{
|
{
|
||||||
@ -1724,9 +1704,6 @@ copyObject(void *from)
|
|||||||
case T_Func:
|
case T_Func:
|
||||||
retval = _copyFunc(from);
|
retval = _copyFunc(from);
|
||||||
break;
|
break;
|
||||||
case T_Array:
|
|
||||||
retval = _copyArray(from);
|
|
||||||
break;
|
|
||||||
case T_ArrayRef:
|
case T_ArrayRef:
|
||||||
retval = _copyArrayRef(from);
|
retval = _copyArrayRef(from);
|
||||||
break;
|
break;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.69 2000/07/17 03:05:01 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.70 2000/07/22 04:22:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -293,25 +293,6 @@ _equalRelabelType(RelabelType *a, RelabelType *b)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
|
||||||
_equalArray(Array *a, Array *b)
|
|
||||||
{
|
|
||||||
if (a->arrayelemtype != b->arrayelemtype)
|
|
||||||
return false;
|
|
||||||
/* We need not check arrayelemlength, arrayelembyval if types match */
|
|
||||||
if (a->arrayndim != b->arrayndim)
|
|
||||||
return false;
|
|
||||||
/* XXX shouldn't we be checking all indices??? */
|
|
||||||
if (a->arraylow.indx[0] != b->arraylow.indx[0])
|
|
||||||
return false;
|
|
||||||
if (a->arrayhigh.indx[0] != b->arrayhigh.indx[0])
|
|
||||||
return false;
|
|
||||||
if (a->arraylen != b->arraylen)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
||||||
{
|
{
|
||||||
@ -800,9 +781,6 @@ equal(void *a, void *b)
|
|||||||
case T_Func:
|
case T_Func:
|
||||||
retval = _equalFunc(a, b);
|
retval = _equalFunc(a, b);
|
||||||
break;
|
break;
|
||||||
case T_Array:
|
|
||||||
retval = _equalArray(a, b);
|
|
||||||
break;
|
|
||||||
case T_ArrayRef:
|
case T_ArrayRef:
|
||||||
retval = _equalArrayRef(a, b);
|
retval = _equalArrayRef(a, b);
|
||||||
break;
|
break;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.123 2000/07/17 03:05:01 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.124 2000/07/22 04:22:46 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Every (plan) node in POSTGRES has an associated "out" routine which
|
* Every (plan) node in POSTGRES has an associated "out" routine which
|
||||||
@ -770,29 +770,6 @@ _outRelabelType(StringInfo str, RelabelType *node)
|
|||||||
node->resulttype, node->resulttypmod);
|
node->resulttype, node->resulttypmod);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Array is a subclass of Expr
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
_outArray(StringInfo str, Array *node)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
appendStringInfo(str,
|
|
||||||
" ARRAY :arrayelemtype %u :arrayelemlength %d :arrayelembyval %c ",
|
|
||||||
node->arrayelemtype,
|
|
||||||
node->arrayelemlength,
|
|
||||||
node->arrayelembyval ? 't' : 'f');
|
|
||||||
|
|
||||||
appendStringInfo(str, " :arrayndim %d :arraylow ", node->arrayndim);
|
|
||||||
for (i = 0; i < node->arrayndim; i++)
|
|
||||||
appendStringInfo(str, " %d ", node->arraylow.indx[i]);
|
|
||||||
appendStringInfo(str, " :arrayhigh ");
|
|
||||||
for (i = 0; i < node->arrayndim; i++)
|
|
||||||
appendStringInfo(str, " %d ", node->arrayhigh.indx[i]);
|
|
||||||
appendStringInfo(str, " :arraylen %d ", node->arraylen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ArrayRef is a subclass of Expr
|
* ArrayRef is a subclass of Expr
|
||||||
*/
|
*/
|
||||||
@ -1508,9 +1485,6 @@ _outNode(StringInfo str, void *obj)
|
|||||||
case T_RelabelType:
|
case T_RelabelType:
|
||||||
_outRelabelType(str, obj);
|
_outRelabelType(str, obj);
|
||||||
break;
|
break;
|
||||||
case T_Array:
|
|
||||||
_outArray(str, obj);
|
|
||||||
break;
|
|
||||||
case T_ArrayRef:
|
case T_ArrayRef:
|
||||||
_outArrayRef(str, obj);
|
_outArrayRef(str, obj);
|
||||||
break;
|
break;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.93 2000/07/17 03:05:01 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.94 2000/07/22 04:22:46 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Most of the read functions for plan nodes are tested. (In fact, they
|
* Most of the read functions for plan nodes are tested. (In fact, they
|
||||||
@ -814,48 +814,6 @@ _readVar()
|
|||||||
return local_node;
|
return local_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------
|
|
||||||
* _readArray
|
|
||||||
*
|
|
||||||
* Array is a subclass of Expr
|
|
||||||
* ----------------
|
|
||||||
*/
|
|
||||||
static Array *
|
|
||||||
_readArray()
|
|
||||||
{
|
|
||||||
Array *local_node;
|
|
||||||
char *token;
|
|
||||||
int length;
|
|
||||||
|
|
||||||
local_node = makeNode(Array);
|
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :arrayelemtype */
|
|
||||||
token = lsptok(NULL, &length); /* get arrayelemtype */
|
|
||||||
local_node->arrayelemtype = strtoul(token, NULL, 10);
|
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :arrayelemlength */
|
|
||||||
token = lsptok(NULL, &length); /* get arrayelemlength */
|
|
||||||
local_node->arrayelemlength = atoi(token);
|
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :arrayelembyval */
|
|
||||||
token = lsptok(NULL, &length); /* get arrayelembyval */
|
|
||||||
local_node->arrayelembyval = (token[0] == 't') ? true : false;
|
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :arraylow */
|
|
||||||
token = lsptok(NULL, &length); /* get arraylow */
|
|
||||||
local_node->arraylow.indx[0] = atoi(token);
|
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :arrayhigh */
|
|
||||||
token = lsptok(NULL, &length); /* get arrayhigh */
|
|
||||||
local_node->arrayhigh.indx[0] = atoi(token);
|
|
||||||
|
|
||||||
token = lsptok(NULL, &length); /* eat :arraylen */
|
|
||||||
token = lsptok(NULL, &length); /* get arraylen */
|
|
||||||
local_node->arraylen = atoi(token);
|
|
||||||
|
|
||||||
return local_node;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* _readArrayRef
|
* _readArrayRef
|
||||||
*
|
*
|
||||||
@ -1835,8 +1793,6 @@ parsePlanString(void)
|
|||||||
return_value = _readExpr();
|
return_value = _readExpr();
|
||||||
else if (length == 8 && strncmp(token, "ARRAYREF", length) == 0)
|
else if (length == 8 && strncmp(token, "ARRAYREF", length) == 0)
|
||||||
return_value = _readArrayRef();
|
return_value = _readArrayRef();
|
||||||
else if (length == 5 && strncmp(token, "ARRAY", length) == 0)
|
|
||||||
return_value = _readArray();
|
|
||||||
else if (length == 3 && strncmp(token, "VAR", length) == 0)
|
else if (length == 3 && strncmp(token, "VAR", length) == 0)
|
||||||
return_value = _readVar();
|
return_value = _readVar();
|
||||||
else if (length == 4 && strncmp(token, "ATTR", length) == 0)
|
else if (length == 4 && strncmp(token, "ATTR", length) == 0)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: nodes.h,v 1.71 2000/07/14 15:43:51 thomas Exp $
|
* $Id: nodes.h,v 1.72 2000/07/22 04:22:47 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -64,7 +64,7 @@ typedef enum NodeTag
|
|||||||
T_Aggref,
|
T_Aggref,
|
||||||
T_SubLink,
|
T_SubLink,
|
||||||
T_Func,
|
T_Func,
|
||||||
T_Array,
|
T_ArrayXXX, /* not used anymore; this tag# is available */
|
||||||
T_ArrayRef,
|
T_ArrayRef,
|
||||||
T_Iter,
|
T_Iter,
|
||||||
T_RelabelType,
|
T_RelabelType,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: primnodes.h,v 1.44 2000/07/17 03:05:27 tgl Exp $
|
* $Id: primnodes.h,v 1.45 2000/07/22 04:22:47 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -389,33 +389,6 @@ typedef struct SubLink
|
|||||||
Node *subselect;
|
Node *subselect;
|
||||||
} SubLink;
|
} SubLink;
|
||||||
|
|
||||||
/* ----------------
|
|
||||||
* Array
|
|
||||||
* arrayelemtype - type of the array's elements (homogenous!)
|
|
||||||
* arrayelemlength - length of that type
|
|
||||||
* arrayelembyval - is the element type pass-by-value?
|
|
||||||
* arrayndim - number of dimensions of the array
|
|
||||||
* arraylow - base for array indexing
|
|
||||||
* arrayhigh - limit for array indexing
|
|
||||||
* arraylen - total length of array object
|
|
||||||
* ----------------
|
|
||||||
*
|
|
||||||
* memo from mao: the array support we inherited from 3.1 is just
|
|
||||||
* wrong. when time exists, we should redesign this stuff to get
|
|
||||||
* around a bunch of unfortunate implementation decisions made there.
|
|
||||||
*/
|
|
||||||
typedef struct Array
|
|
||||||
{
|
|
||||||
NodeTag type;
|
|
||||||
Oid arrayelemtype;
|
|
||||||
int arrayelemlength;
|
|
||||||
bool arrayelembyval;
|
|
||||||
int arrayndim;
|
|
||||||
IntArray arraylow;
|
|
||||||
IntArray arrayhigh;
|
|
||||||
int arraylen;
|
|
||||||
} Array;
|
|
||||||
|
|
||||||
/* ----------------
|
/* ----------------
|
||||||
* ArrayRef: describes an array subscripting operation
|
* ArrayRef: describes an array subscripting operation
|
||||||
*
|
*
|
||||||
@ -423,11 +396,12 @@ typedef struct Array
|
|||||||
* fetching a subarray (array slice), storing a single element into
|
* fetching a subarray (array slice), storing a single element into
|
||||||
* an array, or storing a slice. The "store" cases work with an
|
* an array, or storing a slice. The "store" cases work with an
|
||||||
* initial array value and a source value that is inserted into the
|
* initial array value and a source value that is inserted into the
|
||||||
* appropriate part of the array.
|
* appropriate part of the array; the result of the operation is an
|
||||||
|
* entire new modified array value.
|
||||||
*
|
*
|
||||||
* refattrlength - total length of array object
|
* refattrlength - typlen of array type
|
||||||
* refelemtype - type of the result of the subscript operation
|
* refelemtype - type of the result of the ArrayRef operation
|
||||||
* refelemlength - length of the array element type
|
* refelemlength - typlen of the array element type
|
||||||
* refelembyval - is the element type pass-by-value?
|
* refelembyval - is the element type pass-by-value?
|
||||||
* refupperindexpr - expressions that evaluate to upper array indexes
|
* refupperindexpr - expressions that evaluate to upper array indexes
|
||||||
* reflowerindexpr - expressions that evaluate to lower array indexes
|
* reflowerindexpr - expressions that evaluate to lower array indexes
|
||||||
@ -449,7 +423,7 @@ typedef struct Array
|
|||||||
* Note: currently, refelemtype is NOT the element type, but the array type,
|
* Note: currently, refelemtype is NOT the element type, but the array type,
|
||||||
* when doing subarray fetch or either type of store. It would be cleaner
|
* when doing subarray fetch or either type of store. It would be cleaner
|
||||||
* to add more fields so we can distinguish the array element type from the
|
* to add more fields so we can distinguish the array element type from the
|
||||||
* result type of the subscript operator...
|
* result type of the ArrayRef operator...
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
typedef struct ArrayRef
|
typedef struct ArrayRef
|
||||||
|
Reference in New Issue
Block a user