Skip to content

Commit 4bdb348

Browse files
committed
Remove 'Array' node type, which has evidently been dead code for
a very long time.
1 parent 1afdccc commit 4bdb348

File tree

6 files changed

+13
-154
lines changed

6 files changed

+13
-154
lines changed

src/backend/nodes/copyfuncs.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Portions Copyright (c) 1994, Regents of the University of California
2020
*
2121
* IDENTIFICATION
22-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.117 2000/07/17 03:04:58 tgl Exp $
22+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.118 2000/07/22 04:22:46 tgl Exp $
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
@@ -933,26 +933,6 @@ _copyCaseWhen(CaseWhen *from)
933933
return newnode;
934934
}
935935

936-
static Array *
937-
_copyArray(Array *from)
938-
{
939-
Array *newnode = makeNode(Array);
940-
941-
/* ----------------
942-
* copy remainder of node
943-
* ----------------
944-
*/
945-
newnode->arrayelemtype = from->arrayelemtype;
946-
newnode->arrayelemlength = from->arrayelemlength;
947-
newnode->arrayelembyval = from->arrayelembyval;
948-
newnode->arrayndim = from->arrayndim;
949-
newnode->arraylow = from->arraylow;
950-
newnode->arrayhigh = from->arrayhigh;
951-
newnode->arraylen = from->arraylen;
952-
953-
return newnode;
954-
}
955-
956936
static ArrayRef *
957937
_copyArrayRef(ArrayRef *from)
958938
{
@@ -1724,9 +1704,6 @@ copyObject(void *from)
17241704
case T_Func:
17251705
retval = _copyFunc(from);
17261706
break;
1727-
case T_Array:
1728-
retval = _copyArray(from);
1729-
break;
17301707
case T_ArrayRef:
17311708
retval = _copyArrayRef(from);
17321709
break;

src/backend/nodes/equalfuncs.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Portions Copyright (c) 1994, Regents of the University of California
2525
*
2626
* IDENTIFICATION
27-
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.69 2000/07/17 03:05:01 tgl Exp $
27+
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.70 2000/07/22 04:22:46 tgl Exp $
2828
*
2929
*-------------------------------------------------------------------------
3030
*/
@@ -293,25 +293,6 @@ _equalRelabelType(RelabelType *a, RelabelType *b)
293293
return true;
294294
}
295295

296-
static bool
297-
_equalArray(Array *a, Array *b)
298-
{
299-
if (a->arrayelemtype != b->arrayelemtype)
300-
return false;
301-
/* We need not check arrayelemlength, arrayelembyval if types match */
302-
if (a->arrayndim != b->arrayndim)
303-
return false;
304-
/* XXX shouldn't we be checking all indices??? */
305-
if (a->arraylow.indx[0] != b->arraylow.indx[0])
306-
return false;
307-
if (a->arrayhigh.indx[0] != b->arrayhigh.indx[0])
308-
return false;
309-
if (a->arraylen != b->arraylen)
310-
return false;
311-
312-
return true;
313-
}
314-
315296
static bool
316297
_equalArrayRef(ArrayRef *a, ArrayRef *b)
317298
{
@@ -800,9 +781,6 @@ equal(void *a, void *b)
800781
case T_Func:
801782
retval = _equalFunc(a, b);
802783
break;
803-
case T_Array:
804-
retval = _equalArray(a, b);
805-
break;
806784
case T_ArrayRef:
807785
retval = _equalArrayRef(a, b);
808786
break;

src/backend/nodes/outfuncs.c

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.123 2000/07/17 03:05:01 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.124 2000/07/22 04:22:46 tgl Exp $
1010
*
1111
* NOTES
1212
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -770,29 +770,6 @@ _outRelabelType(StringInfo str, RelabelType *node)
770770
node->resulttype, node->resulttypmod);
771771
}
772772

773-
/*
774-
* Array is a subclass of Expr
775-
*/
776-
static void
777-
_outArray(StringInfo str, Array *node)
778-
{
779-
int i;
780-
781-
appendStringInfo(str,
782-
" ARRAY :arrayelemtype %u :arrayelemlength %d :arrayelembyval %c ",
783-
node->arrayelemtype,
784-
node->arrayelemlength,
785-
node->arrayelembyval ? 't' : 'f');
786-
787-
appendStringInfo(str, " :arrayndim %d :arraylow ", node->arrayndim);
788-
for (i = 0; i < node->arrayndim; i++)
789-
appendStringInfo(str, " %d ", node->arraylow.indx[i]);
790-
appendStringInfo(str, " :arrayhigh ");
791-
for (i = 0; i < node->arrayndim; i++)
792-
appendStringInfo(str, " %d ", node->arrayhigh.indx[i]);
793-
appendStringInfo(str, " :arraylen %d ", node->arraylen);
794-
}
795-
796773
/*
797774
* ArrayRef is a subclass of Expr
798775
*/
@@ -1508,9 +1485,6 @@ _outNode(StringInfo str, void *obj)
15081485
case T_RelabelType:
15091486
_outRelabelType(str, obj);
15101487
break;
1511-
case T_Array:
1512-
_outArray(str, obj);
1513-
break;
15141488
case T_ArrayRef:
15151489
_outArrayRef(str, obj);
15161490
break;

src/backend/nodes/readfuncs.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.93 2000/07/17 03:05:01 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.94 2000/07/22 04:22:46 tgl Exp $
1212
*
1313
* NOTES
1414
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -814,48 +814,6 @@ _readVar()
814814
return local_node;
815815
}
816816

817-
/* ----------------
818-
* _readArray
819-
*
820-
* Array is a subclass of Expr
821-
* ----------------
822-
*/
823-
static Array *
824-
_readArray()
825-
{
826-
Array *local_node;
827-
char *token;
828-
int length;
829-
830-
local_node = makeNode(Array);
831-
832-
token = lsptok(NULL, &length); /* eat :arrayelemtype */
833-
token = lsptok(NULL, &length); /* get arrayelemtype */
834-
local_node->arrayelemtype = strtoul(token, NULL, 10);
835-
836-
token = lsptok(NULL, &length); /* eat :arrayelemlength */
837-
token = lsptok(NULL, &length); /* get arrayelemlength */
838-
local_node->arrayelemlength = atoi(token);
839-
840-
token = lsptok(NULL, &length); /* eat :arrayelembyval */
841-
token = lsptok(NULL, &length); /* get arrayelembyval */
842-
local_node->arrayelembyval = (token[0] == 't') ? true : false;
843-
844-
token = lsptok(NULL, &length); /* eat :arraylow */
845-
token = lsptok(NULL, &length); /* get arraylow */
846-
local_node->arraylow.indx[0] = atoi(token);
847-
848-
token = lsptok(NULL, &length); /* eat :arrayhigh */
849-
token = lsptok(NULL, &length); /* get arrayhigh */
850-
local_node->arrayhigh.indx[0] = atoi(token);
851-
852-
token = lsptok(NULL, &length); /* eat :arraylen */
853-
token = lsptok(NULL, &length); /* get arraylen */
854-
local_node->arraylen = atoi(token);
855-
856-
return local_node;
857-
}
858-
859817
/* ----------------
860818
* _readArrayRef
861819
*
@@ -1835,8 +1793,6 @@ parsePlanString(void)
18351793
return_value = _readExpr();
18361794
else if (length == 8 && strncmp(token, "ARRAYREF", length) == 0)
18371795
return_value = _readArrayRef();
1838-
else if (length == 5 && strncmp(token, "ARRAY", length) == 0)
1839-
return_value = _readArray();
18401796
else if (length == 3 && strncmp(token, "VAR", length) == 0)
18411797
return_value = _readVar();
18421798
else if (length == 4 && strncmp(token, "ATTR", length) == 0)

src/include/nodes/nodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: nodes.h,v 1.71 2000/07/14 15:43:51 thomas Exp $
10+
* $Id: nodes.h,v 1.72 2000/07/22 04:22:47 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -64,7 +64,7 @@ typedef enum NodeTag
6464
T_Aggref,
6565
T_SubLink,
6666
T_Func,
67-
T_Array,
67+
T_ArrayXXX, /* not used anymore; this tag# is available */
6868
T_ArrayRef,
6969
T_Iter,
7070
T_RelabelType,

src/include/nodes/primnodes.h

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: primnodes.h,v 1.44 2000/07/17 03:05:27 tgl Exp $
10+
* $Id: primnodes.h,v 1.45 2000/07/22 04:22:47 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -389,45 +389,19 @@ typedef struct SubLink
389389
Node *subselect;
390390
} SubLink;
391391

392-
/* ----------------
393-
* Array
394-
* arrayelemtype - type of the array's elements (homogenous!)
395-
* arrayelemlength - length of that type
396-
* arrayelembyval - is the element type pass-by-value?
397-
* arrayndim - number of dimensions of the array
398-
* arraylow - base for array indexing
399-
* arrayhigh - limit for array indexing
400-
* arraylen - total length of array object
401-
* ----------------
402-
*
403-
* memo from mao: the array support we inherited from 3.1 is just
404-
* wrong. when time exists, we should redesign this stuff to get
405-
* around a bunch of unfortunate implementation decisions made there.
406-
*/
407-
typedef struct Array
408-
{
409-
NodeTag type;
410-
Oid arrayelemtype;
411-
int arrayelemlength;
412-
bool arrayelembyval;
413-
int arrayndim;
414-
IntArray arraylow;
415-
IntArray arrayhigh;
416-
int arraylen;
417-
} Array;
418-
419392
/* ----------------
420393
* ArrayRef: describes an array subscripting operation
421394
*
422395
* An ArrayRef can describe fetching a single element from an array,
423396
* fetching a subarray (array slice), storing a single element into
424397
* an array, or storing a slice. The "store" cases work with an
425398
* initial array value and a source value that is inserted into the
426-
* appropriate part of the array.
399+
* appropriate part of the array; the result of the operation is an
400+
* entire new modified array value.
427401
*
428-
* refattrlength - total length of array object
429-
* refelemtype - type of the result of the subscript operation
430-
* refelemlength - length of the array element type
402+
* refattrlength - typlen of array type
403+
* refelemtype - type of the result of the ArrayRef operation
404+
* refelemlength - typlen of the array element type
431405
* refelembyval - is the element type pass-by-value?
432406
* refupperindexpr - expressions that evaluate to upper array indexes
433407
* reflowerindexpr - expressions that evaluate to lower array indexes
@@ -449,7 +423,7 @@ typedef struct Array
449423
* Note: currently, refelemtype is NOT the element type, but the array type,
450424
* when doing subarray fetch or either type of store. It would be cleaner
451425
* to add more fields so we can distinguish the array element type from the
452-
* result type of the subscript operator...
426+
* result type of the ArrayRef operator...
453427
* ----------------
454428
*/
455429
typedef struct ArrayRef

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy