提交 ae78a6b6 编写于 作者: H Heikki Linnakangas

Fix a few missing initializations of 'location' fields.

These are just pro forma, as the location field isn't used for anything
after parse analysis, but let's be tidy.
上级 a4fa85a9
......@@ -3006,6 +3006,7 @@ void generate_three_tlists(List *tlist,
new_aggref->aggstar = false;
new_aggref->aggdistinct = false; /* handled in preliminary aggregation */
new_aggref->aggstage = AGGSTAGE_INTERMEDIATE;
new_aggref->location = -1;
new_expr = (Expr *)new_aggref;
}
......@@ -3678,7 +3679,7 @@ Node *split_aggref(Aggref *aggref, MppGroupContext *ctx)
if ( ctx->use_irefs_tlist )
{
TargetEntry *inter_tle;
iref = makeNode(Aggref);
iref->aggfnoid = pref->aggfnoid;
iref->aggtype = transtype;
......@@ -3687,7 +3688,8 @@ Node *split_aggref(Aggref *aggref, MppGroupContext *ctx)
iref->aggstar = false;
iref->aggdistinct = false;
iref->aggstage = AGGSTAGE_INTERMEDIATE;
iref->location = -1;
inter_tle = makeTargetEntry((Expr*)iref, attrno, NULL, false);
inter_tle->ressortgroupref = ctx->split_aggref_sortgroupref;
ctx->irefs_tlist = lappend(ctx->irefs_tlist, inter_tle);
......@@ -3703,6 +3705,7 @@ Node *split_aggref(Aggref *aggref, MppGroupContext *ctx)
fref->aggstar = false;
fref->aggdistinct = false; /* handled in preliminary aggregation */
fref->aggstage = AGGSTAGE_FINAL;
fref->location = -1;
final_tle = makeTargetEntry((Expr*)fref, attrno, NULL, false);
final_tle->ressortgroupref = ctx->split_aggref_sortgroupref;
ctx->frefs_tlist = lappend(ctx->frefs_tlist, final_tle);
......
......@@ -233,6 +233,7 @@ _equalWindowRef(WindowRef *a, WindowRef *b)
COMPARE_SCALAR_FIELD(winindex);
COMPARE_SCALAR_FIELD(winstage);
COMPARE_SCALAR_FIELD(winlevel);
COMPARE_LOCATION_FIELD(location);
return true;
}
......
......@@ -391,6 +391,7 @@ makeAggrefByOid(Oid aggfnoid, List *args)
aggref->aggdistinct = false;
aggref->aggstage = AGGSTAGE_NORMAL;
aggref->aggorder = NULL;
aggref->location = -1;
return aggref;
}
......
......@@ -1262,6 +1262,7 @@ _outWindowRef(StringInfo str, WindowRef *node)
WRITE_UINT_FIELD(winindex);
WRITE_ENUM_FIELD(winstage, WinStage);
WRITE_UINT_FIELD(winlevel);
WRITE_LOCATION_FIELD(location);
}
static void
......
......@@ -1352,6 +1352,7 @@ _readWindowRef(void)
READ_UINT_FIELD(winindex);
READ_ENUM_FIELD(winstage, WinStage);
READ_UINT_FIELD(winlevel);
READ_LOCATION_FIELD(location);
READ_DONE();
}
......
......@@ -3007,12 +3007,12 @@ static List *make_rowkey_targets()
{
FuncExpr *seg;
WindowRef *row;
seg = makeFuncExpr(MPP_EXECUTION_SEGMENT_OID,
MPP_EXECUTION_SEGMENT_TYPE,
NIL,
COERCE_DONTCARE);
row = makeNode(WindowRef);
row->winfnoid = ROW_NUMBER_OID;
row->restype = ROW_NUMBER_TYPE;
......@@ -3020,7 +3020,8 @@ static List *make_rowkey_targets()
row->winspec = row->winindex = 0;
row->winstage = WINSTAGE_ROWKEY; /* so setrefs doesn't get confused */
row->winlevel = 0;
row->location = -1;
return list_make2(
makeTargetEntry((Expr*)seg, 1, pstrdup("segment_join_key"), false),
makeTargetEntry((Expr*)row, 1, pstrdup("row_join_key"), false) );
......@@ -3090,7 +3091,7 @@ static AttrNumber addTargetToCoplan(Node *target, Coplan *coplan, WindowContext
static Aggref* makeWindowAggref(WindowRef *winref)
{
Aggref *aggref = makeNode(Aggref);
aggref->aggfnoid = winref->winfnoid;
aggref->aggtype = winref->restype;
aggref->args = copyObject(winref->args);
......@@ -3098,6 +3099,7 @@ static Aggref* makeWindowAggref(WindowRef *winref)
aggref->aggstar = false; /* at this point in processing, doesn't matter */
aggref->aggdistinct = winref->windistinct;
aggref->aggstage = AGGSTAGE_NORMAL;
aggref->location = -1;
return aggref;
}
......@@ -3105,7 +3107,7 @@ static Aggref* makeWindowAggref(WindowRef *winref)
static Aggref* makeAuxCountAggref()
{
Aggref *aggref = makeNode(Aggref);
aggref->aggfnoid = 2803; /* TODO count(*) oid define in pg_proc.h */
aggref->aggtype = 20; /* TODO count(*) result type oid in pg_proc.h */
aggref->args = NIL;
......@@ -3113,7 +3115,8 @@ static Aggref* makeAuxCountAggref()
aggref->aggstar = true;
aggref->aggdistinct = false;
aggref->aggstage = AGGSTAGE_NORMAL;
aggref->location = -1;
return aggref;
}
......
......@@ -579,6 +579,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
argp->paramid = -1;
argp->paramtype = agg_state_type;
argp->paramtypmod = -1;
argp->location = -1;
args = list_make1(argp);
......@@ -589,6 +590,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
argp->paramid = -1;
argp->paramtype = agg_input_types[i];
argp->paramtypmod = -1;
argp->location = -1;
args = lappend(args, argp);
}
......@@ -599,7 +601,9 @@ build_aggregate_fnexprs(Oid *agg_input_types,
/* see if we have a final function */
if (!OidIsValid(finalfn_oid))
{
*finalfnexpr = NULL;
}
else
{
/*
......@@ -610,6 +614,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
argp->paramid = -1;
argp->paramtype = agg_state_type;
argp->paramtypmod = -1;
argp->location = -1;
args = list_make1(argp);
*finalfnexpr = (Expr *) makeFuncExpr(finalfn_oid,
......@@ -629,6 +634,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
argp->paramid = -1;
argp->paramtype = agg_state_type;
argp->paramtypmod = -1;
argp->location = -1;
args = list_make1(argp);
/* XXX: is agg_state_type correct here? */
......@@ -647,6 +653,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
argp->paramid = -1;
argp->paramtype = agg_state_type;
argp->paramtypmod = -1;
argp->location = -1;
args = list_make1(argp);
*invtransfnexpr = (Expr *) makeFuncExpr(invtransfn_oid,
......@@ -665,6 +672,7 @@ build_aggregate_fnexprs(Oid *agg_input_types,
argp->paramid = -1;
argp->paramtype = agg_state_type;
argp->paramtypmod = -1;
argp->location = -1;
args = list_make1(argp);
*invprelimfnexpr = (Expr *) makeFuncExpr(invprelimfn_oid,
......@@ -672,7 +680,6 @@ build_aggregate_fnexprs(Oid *agg_input_types,
args,
COERCE_DONTCARE);
}
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册