mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Array mega-patch.
Joe Conway
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.148 2003/04/29 22:13:10 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.149 2003/06/24 23:14:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -436,6 +436,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
||||
sublink->operName = NIL;
|
||||
sublink->operOids = NIL;
|
||||
sublink->useOr = FALSE;
|
||||
sublink->isExpr = FALSE;
|
||||
}
|
||||
else if (sublink->subLinkType == EXPR_SUBLINK ||
|
||||
sublink->subLinkType == ARRAY_SUBLINK)
|
||||
@ -463,6 +464,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
||||
sublink->operName = NIL;
|
||||
sublink->operOids = NIL;
|
||||
sublink->useOr = FALSE;
|
||||
sublink->isExpr = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -538,10 +540,30 @@ transformExpr(ParseState *pstate, Node *expr)
|
||||
* here, because make_subplan() will insert type
|
||||
* coercion calls if needed.
|
||||
*/
|
||||
optup = oper(op,
|
||||
exprType(lexpr),
|
||||
exprType((Node *) tent->expr),
|
||||
false);
|
||||
if (!sublink->isExpr)
|
||||
{
|
||||
optup = oper(op,
|
||||
exprType(lexpr),
|
||||
exprType((Node *) tent->expr),
|
||||
false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Oid exprtype = exprType((Node *) tent->expr);
|
||||
Oid elemtype = get_element_type(exprtype);
|
||||
|
||||
if (elemtype != InvalidOid)
|
||||
optup = oper(op,
|
||||
exprType(lexpr),
|
||||
elemtype,
|
||||
false);
|
||||
else
|
||||
optup = oper(op,
|
||||
exprType(lexpr),
|
||||
exprtype,
|
||||
false);
|
||||
}
|
||||
|
||||
opform = (Form_pg_operator) GETSTRUCT(optup);
|
||||
|
||||
if (opform->oprresult != BOOLOID)
|
||||
@ -743,7 +765,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
||||
ArrayExpr *e = (ArrayExpr *) lfirst(element);
|
||||
|
||||
if (!IsA(e, ArrayExpr))
|
||||
elog(ERROR, "Multi-dimensional ARRAY[] must be built from nested array expressions");
|
||||
elog(ERROR, "Multidimensional ARRAY[] must be built from nested array expressions");
|
||||
if (ndims == 0)
|
||||
ndims = e->ndims;
|
||||
else if (e->ndims != ndims)
|
||||
|
Reference in New Issue
Block a user