提交 3a95a982 编写于 作者: H Heikki Linnakangas

Fix confusion on whether a field contains equality or comparison ops.

Most places treated WindowInfo.partkey_operators as an array of equality
operators, except for this one call, which assumed it to be an array of
comparison operators (<).

Running the olap_window regression test revealed this. olap_window is
currently not enabled in the schedule, and we clearly need to fix that,
but I'll leave that for another commit.
上级 efcea64c
......@@ -93,7 +93,7 @@ typedef struct WindowInfo
bool needauxcount;
AttrNumber *partkey_attrs;
Oid *partkey_operators;
Oid *partkey_operators; /* array of equality operators */
List *key_list;
/* coplan assembly */
......@@ -3283,17 +3283,11 @@ static RangeTblEntry *rte_for_coplan(
/* TODO Fix this cheesy estimate. */
double d = new_plan->plan_rows / 100.0;
long num_groups = (d < 0)? 0: ( d > LONG_MAX )? LONG_MAX: (long)d;
int i;
Oid *eqOperators;
eqOperators = (Oid *) palloc(winfo->partkey_len * sizeof(Oid));
for (i = 0; i < winfo->partkey_len; i++)
eqOperators[i] = get_equality_op_for_ordering_op(winfo->partkey_operators[i]);
new_plan = (Plan*)
make_agg(root, coplan->targetlist, NULL,
AGG_SORTED, false,
winfo->partkey_len, winfo->partkey_attrs, eqOperators,
winfo->partkey_len, winfo->partkey_attrs, winfo->partkey_operators,
num_groups,
0, /* num_nullcols */
0, /* input_grouping */
......
......@@ -1016,7 +1016,7 @@ typedef struct Window
int numPartCols; /* number of partitioning columns */
AttrNumber *partColIdx; /* their indexes in the target list
* of the window's outer plan. */
Oid *partOperators;
Oid *partOperators; /* equality operators */
List *windowKeys; /* list of WindowKey nodes */
} Window;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册