aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/nodeIndexscan.c10
-rw-r--r--src/backend/executor/nodeMergeAppend.c30
2 files changed, 20 insertions, 20 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index e60db7813a4..3b8741fc21b 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -829,10 +829,9 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, Index scanrelid,
varattno, /* attribute number to scan */
op_strategy, /* op's strategy */
op_righttype, /* strategy subtype */
+ ((OpExpr *) clause)->inputcollid, /* collation */
opfuncid, /* reg proc to use */
scanvalue); /* constant */
- ScanKeyEntryInitializeCollation(this_scan_key,
- ((OpExpr *) clause)->inputcollid);
}
else if (IsA(clause, RowCompareExpr))
{
@@ -957,10 +956,9 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, Index scanrelid,
varattno, /* attribute number */
op_strategy, /* op's strategy */
op_righttype, /* strategy subtype */
+ inputcollation, /* collation */
opfuncid, /* reg proc to use */
scanvalue); /* constant */
- ScanKeyEntryInitializeCollation(this_sub_key,
- inputcollation);
n_sub_key++;
}
@@ -1042,10 +1040,9 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, Index scanrelid,
varattno, /* attribute number to scan */
op_strategy, /* op's strategy */
op_righttype, /* strategy subtype */
+ saop->inputcollid, /* collation */
opfuncid, /* reg proc to use */
(Datum) 0); /* constant */
- ScanKeyEntryInitializeCollation(this_scan_key,
- saop->inputcollid);
}
else if (IsA(clause, NullTest))
{
@@ -1094,6 +1091,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, Index scanrelid,
varattno, /* attribute number to scan */
InvalidStrategy, /* no strategy */
InvalidOid, /* no strategy subtype */
+ InvalidOid, /* no collation */
InvalidOid, /* no reg proc for this */
(Datum) 0); /* constant */
}
diff --git a/src/backend/executor/nodeMergeAppend.c b/src/backend/executor/nodeMergeAppend.c
index e46af8cff93..73920f21c8c 100644
--- a/src/backend/executor/nodeMergeAppend.c
+++ b/src/backend/executor/nodeMergeAppend.c
@@ -134,30 +134,32 @@ ExecInitMergeAppend(MergeAppend *node, EState *estate, int eflags)
{
Oid sortFunction;
bool reverse;
+ int flags;
if (!get_compare_function_for_ordering_op(node->sortOperators[i],
&sortFunction, &reverse))
elog(ERROR, "operator %u is not a valid ordering operator",
node->sortOperators[i]);
+ /* We use btree's conventions for encoding directionality */
+ flags = 0;
+ if (reverse)
+ flags |= SK_BT_DESC;
+ if (node->nullsFirst[i])
+ flags |= SK_BT_NULLS_FIRST;
+
/*
* We needn't fill in sk_strategy or sk_subtype since these scankeys
* will never be passed to an index.
*/
- ScanKeyInit(&mergestate->ms_scankeys[i],
- node->sortColIdx[i],
- InvalidStrategy,
- sortFunction,
- (Datum) 0);
-
- ScanKeyEntryInitializeCollation(&mergestate->ms_scankeys[i],
- node->collations[i]);
-
- /* However, we use btree's conventions for encoding directionality */
- if (reverse)
- mergestate->ms_scankeys[i].sk_flags |= SK_BT_DESC;
- if (node->nullsFirst[i])
- mergestate->ms_scankeys[i].sk_flags |= SK_BT_NULLS_FIRST;
+ ScanKeyEntryInitialize(&mergestate->ms_scankeys[i],
+ flags,
+ node->sortColIdx[i],
+ InvalidStrategy,
+ InvalidOid,
+ node->collations[i],
+ sortFunction,
+ (Datum) 0);
}
/*