* Fill in SortSupport given an ordering operator (btree "<" or ">" operator). * * Caller must previously have zeroed the SortSupportData structure and then * filled in ssup_cxt, ssup_collation, and ssup_nulls_first. This will fill * in ssup_reverse as well as the comparator function pointer. */
| 132 | * in ssup_reverse as well as the comparator function pointer. |
| 133 | */ |
| 134 | void |
| 135 | PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup) |
| 136 | { |
| 137 | Oid opfamily; |
| 138 | Oid opcintype; |
| 139 | int16 strategy; |
| 140 | |
| 141 | Assert(ssup->comparator == NULL); |
| 142 | |
| 143 | /* Find the operator in pg_amop */ |
| 144 | if (!get_ordering_op_properties(orderingOp, &opfamily, &opcintype, |
| 145 | &strategy)) |
| 146 | elog(ERROR, "operator %u is not a valid ordering operator", |
| 147 | orderingOp); |
| 148 | ssup->ssup_reverse = (strategy == BTGreaterStrategyNumber); |
| 149 | |
| 150 | FinishSortSupportFunction(opfamily, opcintype, ssup); |
| 151 | } |
| 152 | |
| 153 | /* |
| 154 | * Fill in SortSupport given an index relation, attribute, and strategy. |
no test coverage detected