提交 ecbfafbe 编写于 作者: T Tom Lane

Add support for Case exprs to fix_indxqual_references,

so that Case works in WHERE join clauses.  Temporary patch --- this routine
is one of many that ought to be changed to use centralized expression-tree-
walking logic.
上级 6b157f37
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.64 1999/07/27 03:51:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.65 1999/07/29 02:48:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -740,6 +740,37 @@ fix_indxqual_references(Node *clause, Path *index_path)
return (Node *) newnode;
}
else if (IsA(clause, CaseExpr))
{
CaseExpr *oldnode = (CaseExpr *) clause;
CaseExpr *newnode = makeNode(CaseExpr);
newnode->casetype = oldnode->casetype;
newnode->arg = oldnode->arg; /* XXX should always be null
* anyway ... */
newnode->args = (List *)
fix_indxqual_references((Node *) oldnode->args,
index_path);
newnode->defresult =
fix_indxqual_references(oldnode->defresult,
index_path);
return (Node *) newnode;
}
else if (IsA(clause, CaseWhen))
{
CaseWhen *oldnode = (CaseWhen *) clause;
CaseWhen *newnode = makeNode(CaseWhen);
newnode->expr =
fix_indxqual_references(oldnode->expr,
index_path);
newnode->result =
fix_indxqual_references(oldnode->result,
index_path);
return (Node *) newnode;
}
else
{
elog(ERROR, "fix_indxqual_references: Cannot handle node type %d",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册