Fix compatibility with pg18

Upstream commit postgres/postgres@a8025f5 changed last argument of get_ordering_op_properties() from pointer to int16 to pointer to CompareType.
This commit is contained in:
Georgy Shelkovy 2025-04-09 07:26:00 +05:00 committed by GitHub
parent 63ad788b48
commit 3664fc341f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -878,7 +878,11 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString)
Oid ltopr;
Oid btopfamily;
Oid btopcintype;
#if PG_VERSION_NUM >= 180000
CompareType btstrategy;
#else
int16 btstrategy;
#endif
ltopr = get_opfamily_member(entry->opfamily[attn],
entry->opcintype[attn],
@ -890,7 +894,12 @@ hypo_index_store_parsetree(IndexStmt *node, const char *queryString)
&btopcintype,
&btstrategy) &&
btopcintype == entry->opcintype[attn] &&
btstrategy == BTLessStrategyNumber)
#if PG_VERSION_NUM >= 180000
btstrategy == COMPARE_LT
#else
btstrategy == BTLessStrategyNumber
#endif
)
{
/* Successful mapping */
entry->sortopfamily[attn] = btopfamily;