mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Arrange for an explicit cast applied to an ARRAY[] constructor to be applied
directly to all the member expressions, instead of the previous implementation where the ARRAY[] constructor would infer a common element type and then we'd coerce the finished array after the fact. This has a number of benefits, one being that we can allow an empty ARRAY[] construct so long as its element type is specified by such a cast. Brendan Jurd, minor fixes by me.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.318 2008/02/07 20:19:47 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.319 2008/03/20 21:42:48 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1729,6 +1729,14 @@ _equalA_Indirection(A_Indirection *a, A_Indirection *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b)
|
||||
{
|
||||
COMPARE_NODE_FIELD(elements);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
_equalResTarget(ResTarget *a, ResTarget *b)
|
||||
{
|
||||
@@ -2469,6 +2477,9 @@ equal(void *a, void *b)
|
||||
case T_A_Indirection:
|
||||
retval = _equalA_Indirection(a, b);
|
||||
break;
|
||||
case T_A_ArrayExpr:
|
||||
retval = _equalA_ArrayExpr(a, b);
|
||||
break;
|
||||
case T_ResTarget:
|
||||
retval = _equalResTarget(a, b);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user