mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
First phase of work on array improvements. ARRAY[x,y,z] constructor
expressions, ARRAY(sub-SELECT) expressions, some array functions. Polymorphic functions using ANYARRAY/ANYELEMENT argument and return types. Some regression tests in place, documentation is lacking. Joe Conway, with some kibitzing from Tom Lane.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.190 2003/03/20 07:02:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.191 2003/04/08 23:20:01 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -212,10 +212,8 @@ static bool
|
||||
_equalArrayRef(ArrayRef *a, ArrayRef *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(refrestype);
|
||||
COMPARE_SCALAR_FIELD(refattrlength);
|
||||
COMPARE_SCALAR_FIELD(refelemlength);
|
||||
COMPARE_SCALAR_FIELD(refelembyval);
|
||||
COMPARE_SCALAR_FIELD(refelemalign);
|
||||
COMPARE_SCALAR_FIELD(refarraytype);
|
||||
COMPARE_SCALAR_FIELD(refelemtype);
|
||||
COMPARE_NODE_FIELD(refupperindexpr);
|
||||
COMPARE_NODE_FIELD(reflowerindexpr);
|
||||
COMPARE_NODE_FIELD(refexpr);
|
||||
@@ -378,6 +376,17 @@ _equalCaseWhen(CaseWhen *a, CaseWhen *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalArrayExpr(ArrayExpr *a, ArrayExpr *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(array_typeid);
|
||||
COMPARE_SCALAR_FIELD(element_typeid);
|
||||
COMPARE_NODE_FIELD(elements);
|
||||
COMPARE_SCALAR_FIELD(ndims);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalCoalesceExpr(CoalesceExpr *a, CoalesceExpr *b)
|
||||
{
|
||||
@@ -1661,6 +1670,9 @@ equal(void *a, void *b)
|
||||
case T_CaseWhen:
|
||||
retval = _equalCaseWhen(a, b);
|
||||
break;
|
||||
case T_ArrayExpr:
|
||||
retval = _equalArrayExpr(a, b);
|
||||
break;
|
||||
case T_CoalesceExpr:
|
||||
retval = _equalCoalesceExpr(a, b);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user