diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-20 21:42:48 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-03-20 21:42:48 +0000 |
commit | 6b0706ac33ab5da815980c642a9cde9a4cd86b6b (patch) | |
tree | 511ad4743ad55a095cbacea0713b437af36ba9ce /src/backend/nodes/equalfuncs.c | |
parent | 8759b79d0fe8b9937b7cbebfed78480b3e6a94b2 (diff) |
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.
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
-rw-r--r-- | src/backend/nodes/equalfuncs.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 57c51b2c73f..a92911dc27e 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -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 $ * *------------------------------------------------------------------------- */ @@ -1730,6 +1730,14 @@ _equalA_Indirection(A_Indirection *a, A_Indirection *b) } static bool +_equalA_ArrayExpr(A_ArrayExpr *a, A_ArrayExpr *b) +{ + COMPARE_NODE_FIELD(elements); + + return true; +} + +static bool _equalResTarget(ResTarget *a, ResTarget *b) { COMPARE_STRING_FIELD(name); @@ -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; |