1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-16 15:02:33 +03:00

Fix ARRAY[] construct so that in multidimensional case, elements can

be anything yielding an array of the proper kind, not only sub-ARRAY[]
constructs; do subscript checking at runtime not parse time.  Also,
adjust array_cat to make array || array comply with the SQL99 spec.

Joe Conway
This commit is contained in:
Tom Lane
2003-08-17 23:43:27 +00:00
parent de9c553f6b
commit e945246321
12 changed files with 105 additions and 115 deletions

View File

@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: primnodes.h,v 1.91 2003/08/11 23:04:50 tgl Exp $
* $Id: primnodes.h,v 1.92 2003/08/17 23:43:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -587,16 +587,18 @@ typedef struct CaseWhen
/*
* ArrayExpr - an ARRAY[] expression
*
* Note: if ndims > 1, then the array elements are all ArrayExprs of the
* same type and ndims one less.
* Note: if multidims is false, the constituent expressions all yield the
* scalar type identified by element_typeid. If multidims is true, the
* constituent expressions all yield arrays of element_typeid (ie, the same
* type as array_typeid); at runtime we must check for compatible subscripts.
*/
typedef struct ArrayExpr
{
Expr xpr;
Oid array_typeid; /* type of expression result */
Oid element_typeid; /* common type of expression elements */
List *elements; /* the array elements */
int ndims; /* number of array dimensions */
Oid element_typeid; /* common type of array elements */
List *elements; /* the array elements or sub-arrays */
bool multidims; /* true if elements are sub-arrays */
} ArrayExpr;
/*