Skip to content

Commit

Permalink
[columnar] PG16 compatibility after custom index scan feature (#210)
Browse files Browse the repository at this point in the history
fixes #209
  • Loading branch information
mkaruza authored Dec 8, 2023
1 parent 2c1af4b commit a4b1973
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion columnar/src/backend/columnar/columnar.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ columnar_guc_init()
&columnar_index_scan,
false,
PGC_USERSET,
GUC_NO_SHOW_ALL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE,
NULL,
NULL,
NULL);
Expand Down
10 changes: 10 additions & 0 deletions columnar/src/backend/columnar/columnar_tableam.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,11 @@ columnar_index_fetch_begin(Relation rel)
IndexFetchTableData *
columnar_index_fetch_begin_extended(Relation rel, Bitmapset *attr_needed)
{
#if PG_VERSION_NUM >= PG_VERSION_16
Oid relfilenode = rel->rd_locator.relNumber;
#else
Oid relfilenode = rel->rd_node.relNode;
#endif
if (PendingWritesInUpperTransactions(relfilenode, GetCurrentSubTransactionId()))
{
/* XXX: maybe we can just flush the data and continue */
Expand Down Expand Up @@ -661,8 +665,14 @@ columnar_index_fetch_tuple(struct IndexFetchTableData *sscan,
snapshot, randomAccess,
NULL);
if (scan->is_select_query)
#if PG_VERSION_NUM >= PG_VERSION_16
scan->stripeMetadataList =
StripesForRelfilenode(columnarRelation->rd_locator, ForwardScanDirection);
#else
scan->stripeMetadataList =
StripesForRelfilenode(columnarRelation->rd_node, ForwardScanDirection);
#endif

}

uint64 rowNumber = tid_to_row_number(*tid);
Expand Down

0 comments on commit a4b1973

Please sign in to comment.