mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
Get rid of the rather fuzzily defined FlattenedSubLink node type in favor of
making pull_up_sublinks() construct a full-blown JoinExpr tree representation of IN/EXISTS SubLinks that it is able to convert to semi or anti joins. This makes pull_up_sublinks() a shade more complex, but the gain in semantic clarity is worth it. I still have more to do in this area to address the previously-discussed problems, but this commit in itself fixes at least one bug in HEAD, as shown by added regression test case.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.37 2009/01/01 17:23:43 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/nodeFuncs.c,v 1.38 2009/02/25 03:30:37 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1309,14 +1309,6 @@ expression_tree_walker(Node *node,
|
||||
/* groupClauses are deemed uninteresting */
|
||||
}
|
||||
break;
|
||||
case T_FlattenedSubLink:
|
||||
{
|
||||
FlattenedSubLink *fslink = (FlattenedSubLink *) node;
|
||||
|
||||
if (walker(fslink->quals, context))
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case T_PlaceHolderVar:
|
||||
return walker(((PlaceHolderVar *) node)->phexpr, context);
|
||||
case T_AppendRelInfo:
|
||||
@ -1972,17 +1964,6 @@ expression_tree_mutator(Node *node,
|
||||
return (Node *) newnode;
|
||||
}
|
||||
break;
|
||||
case T_FlattenedSubLink:
|
||||
{
|
||||
FlattenedSubLink *fslink = (FlattenedSubLink *) node;
|
||||
FlattenedSubLink *newnode;
|
||||
|
||||
FLATCOPY(newnode, fslink, FlattenedSubLink);
|
||||
/* Assume we need not copy the relids bitmapsets */
|
||||
MUTATE(newnode->quals, fslink->quals, Expr *);
|
||||
return (Node *) newnode;
|
||||
}
|
||||
break;
|
||||
case T_PlaceHolderVar:
|
||||
{
|
||||
PlaceHolderVar *phv = (PlaceHolderVar *) node;
|
||||
|
Reference in New Issue
Block a user