@ -111,10 +111,10 @@ static Var *search_indexed_tlist_for_var(Var *var,
indexed_tlist * itlist ,
indexed_tlist * itlist ,
Index newvarno ,
Index newvarno ,
int rtoffset ) ;
int rtoffset ) ;
static Var * search_indexed_tlist_for_non_var ( Node * node ,
static Var * search_indexed_tlist_for_non_var ( Expr * node ,
indexed_tlist * itlist ,
indexed_tlist * itlist ,
Index newvarno ) ;
Index newvarno ) ;
static Var * search_indexed_tlist_for_sortgroupref ( Node * node ,
static Var * search_indexed_tlist_for_sortgroupref ( Expr * node ,
Index sortgroupref ,
Index sortgroupref ,
indexed_tlist * itlist ,
indexed_tlist * itlist ,
Index newvarno ) ;
Index newvarno ) ;
@ -1440,7 +1440,7 @@ fix_param_node(PlannerInfo *root, Param *p)
elog ( ERROR , " unexpected PARAM_MULTIEXPR ID: %d " , p - > paramid ) ;
elog ( ERROR , " unexpected PARAM_MULTIEXPR ID: %d " , p - > paramid ) ;
return copyObject ( list_nth ( params , colno - 1 ) ) ;
return copyObject ( list_nth ( params , colno - 1 ) ) ;
}
}
return copyObject ( p ) ;
return ( Node * ) copyObject ( p ) ;
}
}
/*
/*
@ -1727,7 +1727,7 @@ set_upper_references(PlannerInfo *root, Plan *plan, int rtoffset)
if ( tle - > ressortgroupref ! = 0 & & ! IsA ( tle - > expr , Var ) )
if ( tle - > ressortgroupref ! = 0 & & ! IsA ( tle - > expr , Var ) )
{
{
newexpr = ( Node * )
newexpr = ( Node * )
search_indexed_tlist_for_sortgroupref ( ( Node * ) tle - > expr ,
search_indexed_tlist_for_sortgroupref ( tle - > expr ,
tle - > ressortgroupref ,
tle - > ressortgroupref ,
subplan_itlist ,
subplan_itlist ,
OUTER_VAR ) ;
OUTER_VAR ) ;
@ -1810,7 +1810,7 @@ convert_combining_aggrefs(Node *node, void *context)
*/
*/
child_agg - > args = NIL ;
child_agg - > args = NIL ;
child_agg - > aggfilter = NULL ;
child_agg - > aggfilter = NULL ;
parent_agg = ( Aggref * ) copyObject ( child_agg ) ;
parent_agg = copyObject ( child_agg ) ;
child_agg - > args = orig_agg - > args ;
child_agg - > args = orig_agg - > args ;
child_agg - > aggfilter = orig_agg - > aggfilter ;
child_agg - > aggfilter = orig_agg - > aggfilter ;
@ -2054,7 +2054,7 @@ search_indexed_tlist_for_var(Var *var, indexed_tlist *itlist,
* so there ' s a correctness reason not to call it unless that ' s set .
* so there ' s a correctness reason not to call it unless that ' s set .
*/
*/
static Var *
static Var *
search_indexed_tlist_for_non_var ( Node * node ,
search_indexed_tlist_for_non_var ( Expr * node ,
indexed_tlist * itlist , Index newvarno )
indexed_tlist * itlist , Index newvarno )
{
{
TargetEntry * tle ;
TargetEntry * tle ;
@ -2095,7 +2095,7 @@ search_indexed_tlist_for_non_var(Node *node,
* And it ' s also faster than search_indexed_tlist_for_non_var .
* And it ' s also faster than search_indexed_tlist_for_non_var .
*/
*/
static Var *
static Var *
search_indexed_tlist_for_sortgroupref ( Node * node ,
search_indexed_tlist_for_sortgroupref ( Expr * node ,
Index sortgroupref ,
Index sortgroupref ,
indexed_tlist * itlist ,
indexed_tlist * itlist ,
Index newvarno )
Index newvarno )
@ -2229,7 +2229,7 @@ fix_join_expr_mutator(Node *node, fix_join_expr_context *context)
/* See if the PlaceHolderVar has bubbled up from a lower plan node */
/* See if the PlaceHolderVar has bubbled up from a lower plan node */
if ( context - > outer_itlist & & context - > outer_itlist - > has_ph_vars )
if ( context - > outer_itlist & & context - > outer_itlist - > has_ph_vars )
{
{
newvar = search_indexed_tlist_for_non_var ( ( Node * ) phv ,
newvar = search_indexed_tlist_for_non_var ( ( Expr * ) phv ,
context - > outer_itlist ,
context - > outer_itlist ,
OUTER_VAR ) ;
OUTER_VAR ) ;
if ( newvar )
if ( newvar )
@ -2237,7 +2237,7 @@ fix_join_expr_mutator(Node *node, fix_join_expr_context *context)
}
}
if ( context - > inner_itlist & & context - > inner_itlist - > has_ph_vars )
if ( context - > inner_itlist & & context - > inner_itlist - > has_ph_vars )
{
{
newvar = search_indexed_tlist_for_non_var ( ( Node * ) phv ,
newvar = search_indexed_tlist_for_non_var ( ( Expr * ) phv ,
context - > inner_itlist ,
context - > inner_itlist ,
INNER_VAR ) ;
INNER_VAR ) ;
if ( newvar )
if ( newvar )
@ -2252,7 +2252,7 @@ fix_join_expr_mutator(Node *node, fix_join_expr_context *context)
/* Try matching more complex expressions too, if tlists have any */
/* Try matching more complex expressions too, if tlists have any */
if ( context - > outer_itlist & & context - > outer_itlist - > has_non_vars )
if ( context - > outer_itlist & & context - > outer_itlist - > has_non_vars )
{
{
newvar = search_indexed_tlist_for_non_var ( node ,
newvar = search_indexed_tlist_for_non_var ( ( Expr * ) node ,
context - > outer_itlist ,
context - > outer_itlist ,
OUTER_VAR ) ;
OUTER_VAR ) ;
if ( newvar )
if ( newvar )
@ -2260,7 +2260,7 @@ fix_join_expr_mutator(Node *node, fix_join_expr_context *context)
}
}
if ( context - > inner_itlist & & context - > inner_itlist - > has_non_vars )
if ( context - > inner_itlist & & context - > inner_itlist - > has_non_vars )
{
{
newvar = search_indexed_tlist_for_non_var ( node ,
newvar = search_indexed_tlist_for_non_var ( ( Expr * ) node ,
context - > inner_itlist ,
context - > inner_itlist ,
INNER_VAR ) ;
INNER_VAR ) ;
if ( newvar )
if ( newvar )
@ -2344,7 +2344,7 @@ fix_upper_expr_mutator(Node *node, fix_upper_expr_context *context)
/* See if the PlaceHolderVar has bubbled up from a lower plan node */
/* See if the PlaceHolderVar has bubbled up from a lower plan node */
if ( context - > subplan_itlist - > has_ph_vars )
if ( context - > subplan_itlist - > has_ph_vars )
{
{
newvar = search_indexed_tlist_for_non_var ( ( Node * ) phv ,
newvar = search_indexed_tlist_for_non_var ( ( Expr * ) phv ,
context - > subplan_itlist ,
context - > subplan_itlist ,
context - > newvarno ) ;
context - > newvarno ) ;
if ( newvar )
if ( newvar )
@ -2380,7 +2380,7 @@ fix_upper_expr_mutator(Node *node, fix_upper_expr_context *context)
/* Try matching more complex expressions too, if tlist has any */
/* Try matching more complex expressions too, if tlist has any */
if ( context - > subplan_itlist - > has_non_vars )
if ( context - > subplan_itlist - > has_non_vars )
{
{
newvar = search_indexed_tlist_for_non_var ( node ,
newvar = search_indexed_tlist_for_non_var ( ( Expr * ) node ,
context - > subplan_itlist ,
context - > subplan_itlist ,
context - > newvarno ) ;
context - > newvarno ) ;
if ( newvar )
if ( newvar )