diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-01-15 08:31:46 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-01-15 08:44:01 +0100 |
commit | 6339f6468e8217f556e38482626250dc72d7cd00 (patch) | |
tree | 71a7eec03c515b4e25c8be754b8d512b1a0e7eaa /src/backend/executor | |
parent | 9a45a89c38f3257b13e09edf382e32fa28b918c2 (diff) | |
download | postgresql-6339f6468e8217f556e38482626250dc72d7cd00.tar.gz postgresql-6339f6468e8217f556e38482626250dc72d7cd00.zip |
Rename RowCompareType to CompareType
RowCompareType served as a way to describe the fundamental meaning of
an operator, notionally independent of an operator class (although so
far this was only really supported for btrees). Its original purpose
was for use inside RowCompareExpr, and it has also found some small
use outside, such as for get_op_btree_interpretation().
We want to expand this now, as a more general way to describe operator
semantics for other index access methods, including gist (to improve
GistTranslateStratnum()) and others not written yet. To avoid future
confusion, we rename the type to CompareType and the symbols from
ROWCOMPARE_XXX to COMPARE_XXX to reflect their more general purpose.
Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execExpr.c | 2 | ||||
-rw-r--r-- | src/backend/executor/execExprInterp.c | 12 | ||||
-rw-r--r-- | src/backend/executor/nodeIndexscan.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/backend/executor/execExpr.c b/src/backend/executor/execExpr.c index 89514f7a4f0..7a800df8cab 100644 --- a/src/backend/executor/execExpr.c +++ b/src/backend/executor/execExpr.c @@ -2102,7 +2102,7 @@ ExecInitExprRec(Expr *node, ExprState *state, /* Finally, examine the last comparison result */ scratch.opcode = EEOP_ROWCOMPARE_FINAL; - scratch.d.rowcompare_final.rctype = rcexpr->rctype; + scratch.d.rowcompare_final.cmptype = rcexpr->cmptype; ExprEvalPushStep(state, &scratch); /* adjust jump targets */ diff --git a/src/backend/executor/execExprInterp.c b/src/backend/executor/execExprInterp.c index b2c00a0a1b1..7dfe17b0a86 100644 --- a/src/backend/executor/execExprInterp.c +++ b/src/backend/executor/execExprInterp.c @@ -1500,22 +1500,22 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull) EEO_CASE(EEOP_ROWCOMPARE_FINAL) { int32 cmpresult = DatumGetInt32(*op->resvalue); - RowCompareType rctype = op->d.rowcompare_final.rctype; + CompareType cmptype = op->d.rowcompare_final.cmptype; *op->resnull = false; - switch (rctype) + switch (cmptype) { /* EQ and NE cases aren't allowed here */ - case ROWCOMPARE_LT: + case COMPARE_LT: *op->resvalue = BoolGetDatum(cmpresult < 0); break; - case ROWCOMPARE_LE: + case COMPARE_LE: *op->resvalue = BoolGetDatum(cmpresult <= 0); break; - case ROWCOMPARE_GE: + case COMPARE_GE: *op->resvalue = BoolGetDatum(cmpresult >= 0); break; - case ROWCOMPARE_GT: + case COMPARE_GT: *op->resvalue = BoolGetDatum(cmpresult > 0); break; default: diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index 865aba08e8a..3b2275e8fe9 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -1344,7 +1344,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, &op_lefttype, &op_righttype); - if (op_strategy != rc->rctype) + if (op_strategy != rc->cmptype) elog(ERROR, "RowCompare index qualification contains wrong operator"); opfuncid = get_opfamily_proc(opfamily, @@ -1421,7 +1421,7 @@ ExecIndexBuildScanKeys(PlanState *planstate, Relation index, MemSet(this_scan_key, 0, sizeof(ScanKeyData)); this_scan_key->sk_flags = SK_ROW_HEADER; this_scan_key->sk_attno = first_sub_key->sk_attno; - this_scan_key->sk_strategy = rc->rctype; + this_scan_key->sk_strategy = rc->cmptype; /* sk_subtype, sk_collation, sk_func not used in a header */ this_scan_key->sk_argument = PointerGetDatum(first_sub_key); } |