1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Back out array mega-patch.

Joe Conway
This commit is contained in:
Bruce Momjian
2003-06-25 21:30:34 +00:00
parent 621691d816
commit 111d8e522b
42 changed files with 676 additions and 2615 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.77 2003/06/24 23:14:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/subselect.c,v 1.78 2003/06/25 21:30:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -83,7 +83,7 @@ typedef struct finalize_primnode_context
static List *convert_sublink_opers(List *lefthand, List *operOids,
List *targetlist, int rtindex,
bool isExpr, List **righthandIds);
List **righthandIds);
static bool subplan_is_hashable(SubLink *slink, SubPlan *node);
static Node *replace_correlation_vars_mutator(Node *node, void *context);
static Node *process_sublinks_mutator(Node *node, bool *isTopQual);
@ -299,12 +299,6 @@ make_subplan(SubLink *slink, List *lefthand, bool isTopQual)
*/
node->subLinkType = slink->subLinkType;
node->useOr = slink->useOr;
node->isExpr = slink->isExpr;
node->exprtype = InvalidOid;
node->elemtype = InvalidOid;
node->elmlen = 0;
node->elmbyval = false;
node->elmalign = '\0';
node->exprs = NIL;
node->paramIds = NIL;
node->useHashTable = false;
@ -380,7 +374,7 @@ make_subplan(SubLink *slink, List *lefthand, bool isTopQual)
exprs = convert_sublink_opers(lefthand,
slink->operOids,
plan->targetlist,
0, node->isExpr,
0,
&node->paramIds);
node->setParam = listCopy(node->paramIds);
PlannerInitPlan = lappend(PlannerInitPlan, node);
@ -463,7 +457,7 @@ make_subplan(SubLink *slink, List *lefthand, bool isTopQual)
node->exprs = convert_sublink_opers(lefthand,
slink->operOids,
plan->targetlist,
0, node->isExpr,
0,
&node->paramIds);
/*
@ -505,7 +499,7 @@ make_subplan(SubLink *slink, List *lefthand, bool isTopQual)
static List *
convert_sublink_opers(List *lefthand, List *operOids,
List *targetlist, int rtindex,
bool isExpr, List **righthandIds)
List **righthandIds)
{
List *result = NIL;
List *lst;
@ -560,38 +554,13 @@ convert_sublink_opers(List *lefthand, List *operOids,
* are not expecting to have to resolve unknown Params, so
* it's okay to pass a null pstate.)
*/
if (!isExpr)
{
result = lappend(result,
make_op_expr(NULL,
tup,
leftop,
rightop,
exprType(leftop),
te->resdom->restype));
}
else
{
Oid exprtype = te->resdom->restype;
Oid elemtype = get_element_type(exprtype);
if (elemtype != InvalidOid)
result = lappend(result,
make_op_expr(NULL,
tup,
leftop,
rightop,
exprType(leftop),
elemtype));
else
result = lappend(result,
make_op_expr(NULL,
tup,
leftop,
rightop,
exprType(leftop),
exprtype));
}
result = lappend(result,
make_op_expr(NULL,
tup,
leftop,
rightop,
exprType(leftop),
te->resdom->restype));
ReleaseSysCache(tup);
@ -702,17 +671,13 @@ convert_IN_to_join(Query *parse, SubLink *sublink)
/*
* The sublink type must be "= ANY" --- that is, an IN operator.
* (We require the operator name to be unqualified, which may be
* overly paranoid, or may not be.) It must not be an Expression
* sublink.
* overly paranoid, or may not be.)
*/
if (sublink->subLinkType != ANY_SUBLINK)
return NULL;
if (length(sublink->operName) != 1 ||
strcmp(strVal(lfirst(sublink->operName)), "=") != 0)
return NULL;
if (sublink->isExpr)
return NULL;
/*
* The sub-select must not refer to any Vars of the parent query.
* (Vars of higher levels should be okay, though.)
@ -765,7 +730,7 @@ convert_IN_to_join(Query *parse, SubLink *sublink)
exprs = convert_sublink_opers(sublink->lefthand,
sublink->operOids,
subselect->targetList,
rtindex, sublink->isExpr,
rtindex,
&ininfo->sub_targetlist);
return (Node *) make_ands_explicit(exprs);
}

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.140 2003/06/24 23:14:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.141 2003/06/25 21:30:30 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -132,28 +132,6 @@ get_rightop(Expr *clause)
return NULL;
}
/*****************************************************************************
* FUNCTION clause functions
*****************************************************************************/
/*
* make_funcclause
* Creates a function clause given its function info and argument list.
*/
Expr *
make_funcclause(Oid funcid, Oid funcresulttype, bool funcretset,
CoercionForm funcformat, List *funcargs)
{
FuncExpr *expr = makeNode(FuncExpr);
expr->funcid = funcid;
expr->funcresulttype = funcresulttype;
expr->funcretset = funcretset;
expr->funcformat = funcformat;
expr->args = funcargs;
return (Expr *) expr;
}
/*****************************************************************************
* NOT clause functions
*****************************************************************************/